723
CAN Controller (CAN)
Chapter 19
Preliminary User’s Manual U17566EE1V2UM00
19.11.2
Transmit history list function
The transmit history list (THL) function records in the transmit history list the
number of the transmit message buffer in which each data frame or remote
frame was received and stored. The THL consists of storage elements
equivalent to up to seven messages, the last out-message pointer (LOPT) with
the corresponding CnLOPT register, and the transmit history list get pointer
(TGPT) with the corresponding CnTGPT register.
The THL is undefined immediately after the transition of the CAN module from
the initialization mode to one of the operation modes.
The CnLOPT register holds the contents of the THL element indicated by the
value of the LOPT pointer minus 1. By reading the CnLOPT register, therefore,
the number of the message buffer that transmitted a data frame or remote
frame first can be checked. The LOPT pointer is utilized as a write pointer that
indicates to what part of the THL a message buffer number is recorded. Any
time a data frame or remote frame is transmitted, the corresponding message
buffer number is recorded to the THL element indicated by the LOPT pointer.
Each time recording to the THL has been completed, the LOPT pointer is
automatically incremented. In this way, the number of the message buffer that
has received and stored a frame will be recorded chronologically.
The TGPT pointer is utilized as a read pointer that reads a recorded message
buffer number from the THL. This pointer indicates the first THL element that
the CPU has not yet read. By reading the CnTGPT register by software, the
number of a message buffer that has completed transmission can be read.
Each time a message buffer number is read from the CnTGPT register, the
TGPT pointer is automatically incremented.
If the value of the TGPT pointer matches the value of the LOPT pointer, the
CnTGPT.THPM bit (transmit history list pointer match) is set to 1. This
indicates that no message buffer numbers that have not been read remain in
the THL. If a new message buffer number is recorded, the LOPT pointer is
incremented and because its value no longer matches the value of the TGPT
pointer, the THPM bit is cleared. In other words, the numbers of the unread
message buffers exist in the THL.
If the LOPT pointer is incremented and matches the value of the TGPT pointer
minus 1, the TOVF bit (transmit history list overflow) of the CnTGPT register is
set to 1. This indicates that the THL is full of message buffer numbers that
have not been read. If a new message is received and stored, the message
buffer number recorded last is overwritten by the number of the message buffer
that received and stored the new message. After the TOVF bit has been set
(1), therefore, the recorded message buffer numbers in the THL do not
completely reflect the chronological order.
electronic components distributor