![](http://datasheet.mmic.net.cn/30000/M30855FHTGP_datasheet_2359399/M30855FHTGP_377.png)
Page 354
4
9
4
f
o
5
0
2
,
1
0
.
l
u
J
3
0
.
1
.
v
e
R
3
0
1
0
-
7
3
0
B
9
0
J
E
R
23. CAN Module
)
T
5
8
/
C
2
3
M
,
5
8
/
C
2
3
M
(
p
u
o
r
G
5
8
/
C
2
3
M
Table 23.4 CiMCTLj register(i=0,1, j= 0 to 15) Settings and Transmit/Receive Mode
Settings for the CiMCTLj Register
TRMREQ RECREQ REMOTE RSPLOCK REMACTIVE MSGLOST TRMACTIVE SENTDATA
Transmit/Receive Mode
INVALDATA NEWDATA
00
0
No frame is transmitted or received
0
1
0
Data frame is received
0
1
0
Remote frame is received
or
(The data frame is transmitted
0
after receiving the remote frame.)
1
0
Data frame is transmitted
10
0
Remote frame is transmitted
(The data frame is received after
transmitting the remote frame)
23.1.20.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 data transmission is com-
pleted 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 j (j=0 to 15) is received in the receive message slot as ex-
pected.
NOTES:
1. To read a received data from the message slot j, 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 read data 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
unchanged 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 com-
pleted.
23.1.20.2 TRMACTIVE/INVALDATA Bit
The TRMACTIVE/INVALDATA bit indicates that the CAN protcol controller is transmitting or receiving
a message and accessing the message slot j. 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" (except transmitting) when a data transmission is
started in the message slot. If the CAN module loses in bus arbitration, the
TRMACTIVE bit is set to "0" (stops transmitting) when 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 received
message into the messaqe slot j, after a message reception is completed. Then the
INVALDATA bit is set to "0" after a message storage is completed. Data, if read
from the message slot j while this bit is set to "1", is indeterminate.