
CHAPTER 19 CAN CONTROLLER
User’s Manual U16541EJ4V0UD
791
19.10 Message Transmission
19.10.1 Message transmission
In all the operation modes, if the C0MCTRLm.TRQ bit is set to 1 in a message buffer that satisfies the following
conditions, the message buffer that is to transmit a message is searched.
Used as a message buffer
(C0MCONFm.MA0 bit set to 1.)
Set as a transmit message buffer
(C0MCONFm.MT2 to C0MCONFm.MT0 bits set to 000B.)
Ready for transmission
(C0MCTRLm.RDY bit is set to 1.)
Remark
m = 00 to 31
The CAN system is a multi-master communication system.
In a system like this, the priority of message
transmission is determined based on message identifiers (IDs). To facilitate transmission processing by software
when there are several messages awaiting transmission, the CAN module uses hardware to check the ID of the
message with the highest priority and automatically identifies that message. This eliminates the need for software-
based priority control.
Transmission priority is controlled by the identifier (ID).
Figure 19-30. Message Processing Example
Message No.
The CAN module transmits messages in the following sequence.
Message waiting to be transmitted
ID = 120H
ID = 229H
ID = 223H
ID = 023H
ID = 123H
0
1
2
3
4
5
6
7
8
9
1. Message 6
2. Message 1
3. Message 8
4. Message 5
5. Message 2
After the transmit message search, the transmit message with the highest priority of the transmit message buffers
that have a pending transmission request (message buffers with the TRQ bit set to 1 in advance) is transmitted.
If a new transmission request is set, the transmit message buffer with the new transmission request is compared
with the transmit message buffer with a pending transmission request. If the new transmission request has a higher
priority, it is transmitted, unless transmission of a message with a low priority has already started. If transmission of a
message with a low priority has already started, however, the new transmission request is transmitted later. The
highest priority is determined according to the following rules.