Programming Examples
9-92
ADSP-BF537 Blackfin Processor Hardware Reference
JUMP Wait_Here_For_IRQs;
/* ===================================================
** CAN_TX_HANDLER
**
** ISR clears the interrupt request from MB8, writes
** new data to be sent, and requests to send again
**
** ===================================================
*/
CAN_TX_HANDLER:
[--SP] = (R7:6, P5:5);
/* Save Clobbered Registers */
[--SP] = ASTAT;
P5.H = HI(CAN_MBTIF1);
P5.L = LO(CAN_MBTIF1);
R7 = MBTIF8;
W[P5] = R7;
/* Clear Interrupt Request Bit for MB08 */
P5.L = LO(CAN_MB_DATA2(8));
R7 = W[P5](Z);
/* Retrieve Previously Sent Data */
R6 = 0xFF;
/* Mask Upper Byte to Check Lower */
R6 = R6 & R7;
/* Byte for Wrap */
R5 = 0xFF;
/* Check Wrap Condition */
CC = R6 == R5; /* Check if Lower Byte Wraps */
IF CC JUMP HANDLE_COUNT_WRAP;
R7 += 1;
/* If no wrap, Increment Count */
JUMP PREPARE_TO_SEND;
HANDLE_COUNT_WRAP:
R6 = 0xFF00(Z);
/* Mask Off Lower Byte */
R7 = R7 & R6;
/* Sets Lower Byte to 0 */
R6 = 0x0100(Z);
/* Increment Value for Upper Byte */
R7 = R7 + R6;
/* Increment Upper Byte */
PREPARE_TO_SEND:
W[P5] = R7;
/* Set New TX Data */
P5.L = LO(CAN_TRS1);
R7 = TRS8;
Summary of Contents for Blackfin ADSP-BF537
Page 42: ...Contents xlii ADSP BF537 Blackfin Processor Hardware Reference ...
Page 90: ...Development Tools 1 32 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 138: ...Programming Examples 4 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 340: ...SDC Programming Examples 6 84 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 606: ...Programming Examples 9 94 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 660: ...Programming Examples 10 54 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 720: ...Electrical Specifications 11 60 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 840: ...Programming Examples 13 42 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 876: ...Programming Examples 14 36 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 938: ...Programming Examples 15 62 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 958: ...Programming Examples 17 12 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 986: ...Programming Examples 18 28 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1162: ...G 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1218: ...Index I 56 ADSP BF537 Blackfin Processor Hardware Reference ...