
Source Code Files
rti.c
DRM033 — Rev 0
Designer Reference Manual
MOTOROLA
Source Code Files
131
{
tU08 tmp;
tU08 sendData[9]; /* pass data to CAN Tx routine */
static count = 0; /* routine counter */
crg.crgflg.bit.rtif = 1; /* clear flag of real time interrupt */
count++;
atd0Read(); /* perform analog to digital conversion */
#if 0
while (sci0.scisr1.bit.tdre == 0); /* SCI testing transmission */
tmp = sci0.scisr1.byte;
sci0.scidrl.byte = 0x41;
#endif
#ifdef BLACK_BOX
set1stAnalogData(); /* store desired data to sendData */
tmp = CAN_LoadMB(3, sendData, 0); /* load buf */
tmp = CAN_TransmitMB(3, 0); /* send buf */
set2ndAnalogData(); /* store desired data to sendData */
tmp = CAN_LoadMB(4, sendData, 0); /* load buf */
tmp = CAN_TransmitMB(4, 0); /* send buf */
#else
if (count == 13) /* analog status, part 1 */
{
set1stAnalogData(); /* store desired data to sendData */
tmp = CAN_LoadMB(3, sendData, 0); /* load buf */
tmp = CAN_TransmitMB(3, 0); /* send buf */
}
if (count == 14) /* analog status, part 2 */
{
set2ndAnalogData(); /* store desired data to sendData */
tmp = CAN_LoadMB(4, sendData, 0); /* load buf */
tmp = CAN_TransmitMB(4, 0); /* send buf */
}
#endif
if (count == 15)
{
count = 0;
setDigitData(); /* store desired data to sendData */
tmp = CAN_LoadMB(2, sendData, 0); /* load buf */
tmp = CAN_TransmitMB(2, 0); /* send buf */
}
}
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.