
Page 347
8
4
f
o
6
0
2
,
1
3
.
n
a
J
1
3
.
1
.
v
e
R
1
3
1
0
-
4
3
0
B
9
0
J
E
R
22. CAN Module
)
T
3
8
/
C
2
3
M
,
3
8
/
C
2
3
M
(
p
u
o
r
G
3
8
/
C
2
3
M
22.1.16.1 SENTDATA/NEWDATA Bit
The SENTDATA/NEWDATA bit indicates that the CAN module has transmitted or received the CAN
message. Set the SENTDATA/NEWDATA bit to "0 " (not transmitted or not received) by program
before data transmission and reception is started. The SENTDATA/NEWDATA bit is not set to "0"
automatically. When the TRMACTIVE/INVALDATA bit is set to "1" (during transmission or storing
received data), the SENTDATA/NEWDATA bit cannot be set to "0".
SENTDATA
: The SENTDATA bit is set to "1" (transmit complete) when a data transmission is
completed in the transmit message slot.
NEWDATA
: The NEWDATA bit is set to "1" (receive complete) when the message to be stored into
the message slot i (i=0 to 15) is received in the receive message slot as expected.
NOTES:
1. To read a received data from the message slot i, set the NEWDATA bit to "0" before reading. If
the NEWDATA bit is set to "1" immediately after reading, this indicates that new received data
has been stored into the message slot while reading and the data read contains an indetermi-
nate value. In this case, discard the data with indeterminate value and then read the message
slot again after the NEWDATA bit is set to "0".
2. When the remote frame is transmitted or received, the SENTDATA/NEWDATA bit remains un-
changed after the remote frame transmission or reception is completed. The SENTDATA/
NEWDATA bit is set to "1" when a subsequent data frame transmission or reception is completed.
22.1.16.2 TRMACTIVE/INVALDATA Bit
The TRMACTIVE/INVALDATA bit indicates that the CAN module is transmitting or receiving a mes-
sage and accessing the message slot i. The TRMACTIVE/INVALDATA bit is set to "1" when the CAN
module is accessing the message slot and to "0 " when not accessing the message slot.
TRMACTIVE
: The TRMACTIVE bit is set to "1" (transmitting) when a data transmission is started
in the message slot. The TRMACTIVE bit is set to "0" (stops transmitting) if the
CAN module loses in bus arbitration and a CAN bus error occurs or when a data
transmission is completed.
INVALDATA
: The INVALDATA bit is set to "1" (storing received data) when receiving a message
and storing a received data into the message slot i. Data, if read from the message
slot i while this bit is set to "1", is indeterminate.
22.1.16.3 MSGLOST Bit
The MSGLOST bit is valid only when the message slot is set for reception. The MSGLOST bit is set to
"1" (overrun error occurred) when the message slot i is overwritten by a new received message while
the NEWDATA bit set to "1" (already received).
The MSGLOST bit is not automatically set to "0". Set to "0" (no overrun error occurred) by program.
22.1.16.4 REMACTIVE Bit
The C0MCTL0 to C0MCTL15 registers all have the same function when the STATE_BASICCAN bit is
set to "0" (other than BasicCAN mode).
The REMACTIVE bit is set to "1" (remote frame) when the message slot i is set to transmit or receive
the remote frame. The REMACTIVE bit is set to "0" (data frame) after the remote frame has been
transmitted or received.
The functions of the C0MCTL14 and C0MCTL15 registers change when the STATE_BASICCAN bit is
set to "1" (BasicCAN mode). When the REMACTIVE bit is set to "0", this indicates that a message
stored into the message slot is the data frame. When the REMACTIVE bit is set to "1", this indicates a
message stored into the message slot is the remote frame.