CAN Module
deveopmen
Rev.B2 for proof reading
Mitsubishi Microcomputers
M32C/83 group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
201
1. CAN0 control register 0
Bit 0: CAN reset bits 0 and 1 (Reset0 and Reset1)
If the Reset0 and Reset1 bits both are set from 1 to 0, CAN communication is enabled after detecting
11 consecutive recessive bits. The CAN Timestamp Register starts counting at the same time com-
munication is enabled.
In no case will the CAN be reset unless transmission of all messages are completed.
Note 1: Reset0 and Reset1 bits must both be cleared to "0" or set to "1" simutnously.
Note 2: Setting a new transmit request is inhibited before the CAN Status Register State_Reset bit is
set to 1 and the CAN module is reset after setting the Reset0 and Reset1 bits to 1.
Note 3: When the CAN module is reset by setting the Reset0 and Reset1 bits to 1, the CAN
Timestamp Register (C0TSR), CAN Transmit Error Counter (C0TEC), and CAN Receive
Error Counter (C0REC) are initialized to 0.
Note 4: If Reset0 and Reset1 bits sre set to "1" during communication, the CAN
OUT
pin output goes
"H" immediately after that. Therefore, setting these bits to 1 while the CAN module is sending
a frame may cause a CAN bus error.
Note 5: To CAN communication, function select register A1 (PS1), function select register A2 (PS2),
function select register B1 (PSL1), function select register B2 (PSL2), function select register
C (PSC) and input function select register (IPS) must be set. These registers must be set
when CAN module is reset.
Bit 1: Loopback mode select bit (LoopBack)
Setting the LoopBack bit to 1 enables loopback mode, so that if any receive slot whose ID matches
that of a frame the CAN module itself transmitted exists, the frame is received.
Note 1: ACK is not returned for the transmit frame.
Note 2: Do not set or reset the LoopBack bit while the CAN module is operating (CAN Status Register
State_Reset bit = 0).
Bit 3: BasicCAN mode select bit (BasicCAN)
If this bit is set to 1, message slots 14 and 15 operate in BasicCAN mode.
Operation during BasicCAN mode
In BasicCAN mode, message slots 14 and 15 are used with a dual-structured buffer. The received
frames whose IDs are found matching by acceptance filtering are stored in slots 14 and 15 alter-
nately. When slot 14 is active (i.e., the next received frame is to be stored in slot 14), this acceptance
filtering is accomplished using the ID that is set in slot 14 and local mask A; when slot 15 is active, it
is accomplished using the ID that is set in slot 15 and local mask B. Frame types of both data frame
and remote frame can be received.
When using BasicCAN mode, setting the IDs of two slots and the mask registers the same way helps
to reduce the possibility of causing an overrun error.
Procedure for entering BasicCAN mode
Make the following settings during initialization.
(1) Set the BasicCAN bit to 1.
(2) Set the IDs of slots 14 and 15 and Local Mask Registers A and B. (We recommend setting the
same value)
(3) Set the frame format to be handled with slots 14 and 15 (standard or extended) in the CAN
Extended ID Register. (We recommend setting the same format)