beautypg.com

Transmitting and receiving messages, Transmitting data messages, Receiving data messages – Maxim Integrated High-Speed Microcontroller Users Guide: DS80C390 Supplement User Manual

Page 142: Ransmitting and, Eceiving, Essages

background image

High-Speed Microcontroller User’s Guide: DS80C390 Supplement

142 of 158

message center 15). This AND’ed value is then used in place of CnEGM3-0 or CnSGM1-0 when
performing basic arbitration as described previous. If the MDME bit is set then the incoming message
must pass the media arbitration test as well.

Message center 15 has a buffered FIFO arrangement to allow up to two received messages to be received
without being lost prior to the microcontroller reading of the first message. The first message received by
message center 15 is stored in the normal MOVX memory location for Message Center 15, if the previous
message has been already read by the microcontroller. If the first message has not been read, then the
incoming message is buffered internally until the first message is read, at which time the second message
is automatically loaded into the first (MOVX) message 15 slot, allowing software to then read the second
message. The CAN module determines if the first message has been read is by software clearing the
DTUP bit and the EXTRQ bit. If a third message comes in before the second message has been copied
into the MOVX message 15 slot, then the third message will write over the second buffered message.
Software should clear the INTRQ bit as well as the DTUP and EXTRQ bit after reading each message in
the MOVX message 15 center. The WTOE bit associated with message center 15 has unique operating
considerations, described later in the section regarding the function of the WTOE bit.

TRANSMITTING AND RECEIVING MESSAGES

All CAN data is sent and received through message centers. All CAN message centers for both CAN
modules are identical with the exception of message center 15. Message center 15 has been designed as a
receive only center and is also shadow-buffered to help prevent the loss of incoming messages, when the
software is not able to read the first message before the next message is loaded. All message centers, with
the exception of message center 15, are capable of four different operations. These are:

1. Transmitting a data message
2. Receiving a data message
3. Transmitting a remote frame request
4. Receiving a remote frame request

Transmitting Data Messages
Starting with the lowest numbered message center (highest priority) each CAN module sequentially scans
each message center until it finds a message center that is proper enabled for transmission (T/ R = 1, TIH
= 0, DTUP = 1, MSRDY = 1, and MTRQ = 1). The contents of the respective message center is then
transferred to the transmit buffer and the CAN module attempts to transmit the message. If successful the
appropriate MTRQ bit will be cleared to 0, indicating that the message was successfully sent. Following a
successful transmission, loss of arbitration, or an error condition, the CAN module will again search for a
properly configured message center, starting with the lowest numbered message center. This search
relationship will always allow the highest priority message center to be transmitted, independent of the
last successful (MTRQ = 0) or unsuccessful (MTRQ = 1) message transmission.

Receiving Data Messages
Each incoming data message is compared sequentially with each receive enabled (T/ R = 0) message
center starting with the lowest numbered message center (highest priority) and proceeding to the highest
numbered message center. This testing continues until a match is found (incorporating masking functions
as required), at which time the incoming message is stored in the respective message center. Higher
numbered message centers that are not reviewed prior to the match will not be evaluated during the
current message test. When the WTOE=1, the CAN module can overwrite receive message centers that