Hardware Reference
In-Depth Information
13.9.8 MSCAN Initialization
The MSCAN needs to be configured before it can operate properly. The procedures for con-
figuring the MSCAN out of reset and in normal mode are different.
MSCAN I NITIALIZATION O UT OF R ESET
The procedure to initialize the MSCAN after reset is as follows:
Enable the CAN module by setting the CANE bit of the CAN x CTL1 register to 1.
Request to enter the initialization mode by setting the INITRQ bit of the
CAN x CTL0 register to 1.
Make sure that the CAN initialization mode is entered by waiting until the
INITAK bit of the CAN x CTL1 register has been set to 1.
Write to the configuration registers (CAN x CTL1, CAN x BTR0, CAN x BTR1,
CAN x IDAC, CAN x IDAR0,7, CAN x IDMR0,7) in initialization mode (both the
INITRQ and INITAK bits are set).
Clear the INITRQ bit to leave initialization mode and enter normal mode.
MSCAN I NITIALIZATION IN N ORMAL M ODE
Make sure that the MSCAN transmission queue is empty and bring the module
into sleep mode by asserting the SLPRQ bit and waiting for the SLPAK bit to be set.
Enter the initialization mode.
Write to the configuration registers in initialization mode.
Clear the INITRQ bit to leave the initialization mode and continue in normal
mode.
13.10 Physical CAN Bus Connection
The CAN protocol is designed for data communication over a short distance. It does not
specify what medium to use for data transmission. The user can choose optical fiber, shielded
cable, or unshielded cable as the transmission medium. Using a shielded or unshielded cable is
recommended for a short-distance communication.
A typical CAN bus system setup using a cable is illustrated in Figure 13.41. The resistor R T
is the terminating resistor. Each node uses a transceiver to connect to the CAN bus. The CAN
bus transceiver is connected to the bus via two bus terminals, CAN_H and CAN_L, which
Node
Node
Node
Node
1
2
3
n
CAN_H
R T
(120 Ω
R T = 120 Ω
)
CAN_L
Figure 13.41 A typical CAN bus setup using cable
 
Search WWH ::




Custom Search