Download Print this page

Renesas M16C/50 Series User Manual page 651

Advertisement

M16C/5L Group, M16C/56 Group
23.6.2
Transmission
Figure 23.45 shows an operation example of data frame transmission. This example shows the
operation of transmitting messages that has been set in registers C0MCTL0 and C0MCTL1.
SOF
CAN bus
Next transmission scan
TRMREQ
TRMACTIVE
SENTDATA
TRMREQ
TRMACTIVE
SENTDATA
CAN0
transmission
complete
interrupt
TRMST
TRMREQ, TRMACTIVE, SENTDATA: Bits in the C0MCTLj register (j = 0 to 31)
TRMST: Bit in the C0STR register
Figure 23.45 Operation Example of Data Frame Transmission
(1) When a TRMREQ bit in the C0MCTLj register (j = 0 to 31) is set to 1 (transmit mailbox) in bus-idle
state, the mailbox scan procedure starts to decide the highest-priority mailbox for transmission.
Once the transmit mailbox is decided, the TRMACTIVE bit in the C0MCTLj register is set to 1 (from
when a transmission request is received until transmission is completed, or an error/arbitration lost
has occurred), the TRMST bit in the C0STR register is set to 1 (transmission in progress), and the
CAN module starts transmission.
(2) If other TRMREQ bits are set, the transmission scan procedure starts with the CRC delimiter for
the next transmission.
(3) If transmission is completed without losing arbitration, the SENTDATA bit in the C0MCTLj register
is set to 1 (transmission completed) and the TRMACTIVE bit is set to 0 (transmission is pending, or
no transmission request). If the interrupt enable bit in the C0MIER register is 1 (interrupt enabled),
the CAN0 transmission complete interrupt request is generated.
(4) When requesting the next transmission from the same mailbox, set bits SENTDATA and TRMREQ
to 0, then set the TRMREQ bit to 1 after checking that bits SENTDATA and TRMREQ have been set
to 0.
Note:
1.
If arbitration is lost after the CAN module starts transmission, the TRMACTIVE bit is set to 0. The
transmission scan procedure is performed again to search for the highest-priority transmit
mailbox from the beginning of the CRC delimiter. If an error occurs either during transmission or
following the loss of arbitration, the transmission scan procedure is performed again from the
start of the error delimiter to search for the highest-priority transmit mailbox.
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
Transmit message in mailbox 0
CRC
CRC
CRC
EOF
delimiter
Next transmission scan
(1)
Transmit message in mailbox 1
IFS SOF
CRC
23. CAN Module
CRC
EOF
IFS
delimiter
Next transmission scan
Page 614 of 803

Advertisement

loading