ADSP-BF537 Blackfin Processor Hardware Reference
9-87
CAN Module
Programming Examples
The following CAN code examples (
through
) show how to program the CAN hardware and timing, initialize
mailboxes, perform transfers, and service interrupts. Each of these code
examples assumes that the appropriate header file is included in the source
code (that is,
#include <defBF537.h>
for ADSP-BF537 projects).
CAN Setup Code
The following code initializes the port pins to connect to the CAN con-
troller and configures the CAN timing parameters.
Listing 9-2. Initializing CAN
Initialize_CAN:
P0.H = HI(PORT_MUX);
/* CAN pins muxed on Port J */
P0.L = LO(PORT_MUX);
R0 = PJCE_CAN(Z);
/* Enable CAN TX/RX pins */
W[P0] = R0;
SSYNC;
/* ===================================================
** Set CAN Bit Timing
**
** CAN_TIMING - SJW, TSEG2, and TSEG1 governed by:
** SJW <= TSEG2 <= TSEG1
**
** ===================================================
*/
P0.H = HI(CAN_TIMING);
P0.L = LO(CAN_TIMING);
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 ...