ADSP-BF537 Blackfin Processor Hardware Reference
9-89
CAN Module
Initializing and Enabling CAN Mailboxes
Before the CAN can transfer data, the mailbox area must be properly set
up and the controller must be initialized properly.
Listing 9-3. Initializing and Enabling Mailboxes
CAN_Initialize_Mailboxes:
P0.H = HI(CAN_MD1);
/* Configure Mailbox Direction */
P0.L = LO(CAN_MD1);
R0 = W[P0](Z);
BITCLR(R0, BITPOS(MD8));
/* Set MB08 for Transmit */
BITSET(R0, BITPOS(MD9));
/* Set MB09 for Receive */
W[P0] = R0;
SSYNC;
/* ===================================================
** Populate CAN Mailbox Area
**
** Mailbox 8 transmits ID 0x411 with 4 bytes of data
** Bytes 0 and 1 are a data pattern 0xAABB. Bytes 2
** and 3 will be a count value for the number of times
** that message is properly sent.
**
** Mailbox 9 will receive message ID 0x007
**
** ===================================================
*/
/* Initialize Mailbox 8 For Transmit */
R0 = 0x411 << 2;
/* Put Message ID in correct slot */
P0.L = LO(CAN_MB_ID1(8));
/* Access MB08 ID1 Register */
W[P0] = R0;
/* Remote frame disabled, 11 bit ID */
R0 = 0;
P0.L = LO(CAN_MB_ID0(8));
W[P0] = R0;
/* Zero Out Lower ID Register */
R0 = 4;
P0.L = LO(CAN_MB_LENGTH(8));
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 ...