Message center 15, Transmitting and receiving messages, Transmitting data messages – Maxim Integrated High-Speed Microcontroller Users Guide: Network Microcontroller Supplement User Manual

Page 154

Advertising
background image

High-Speed Microcontroller User’s

Guide: Network Microcontroller

Supplement

154

(C0SGM0–1) when EX/ST = 0, or the extended global mask registers (C0EGM0–3) when EX/ST = 1, when deciding if there is an ID

match. A comparison between bits in the incoming message ID and arbitration register bits is only made for bit positions that corre-

spond to a 1 in the appropriate mask register. Bits corresponding to 0 in the mask register are ignored, creating a “don’t care” condi-

tion. Filling the mask register with all 0s while MEME = 1 causes the arbitration circuitry to automatically match all message IDs. Filling

the mask register with all 1s while MEME = 1 requires an exact match between the incoming message ID and the arbitration registers,

just as is the case when MEME = 0.

Media arbitration is an optional second arbitration performed if the media identification mask enable bit (MDME) is set in the C0MxF

message center register. Media arbitration compares the first and second byte of the data field in each incoming message against two

8-bit media arbitration bytes (stored at locations C0MA0, C0MA1). Each media arbitration byte has an associated media identification

mask: C0MID0 for C0MA0 and C0MID1 for C0MA1. Media byte comparison is made only for those bits corresponding to a 1 in the

media identification mask registers. When MDME = 1, the first two data bytes of the incoming message must pass media byte arbi-

tration as defined by C0MA0:1 and C0MID0:1 before being loaded into the respective message center. However, unlike the identifica-

tion mask enable (MEME), when MDME = 0, no testing is performed of the first two bytes of the incoming data field.

MESSAGE CENTER 15

Message center 15 supports an additional set of masks to supplement basic arbitration. While this message center performs basic

and media arbitration as per message centers 1–14, it also uses the C015M3–0 mask registers to perform an additional level of filter-

ing during basic (i.e., not media) arbitration. When determining arbitration for message center 15, the contents of C015M3–0 are log-

ically ANDed with either C0EGM3–0 (if EX/ST = 1 for message center 15) or C0SGM1-0 (if EX/ST = 0 for message center 15). This

ANDed value is then used in place of C0EGM3–0 or C0SGM1-0 when performing basic arbitration as described previously. If the

MDME bit is set, then the incoming message must also pass the media arbitration test.

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 mem-

ory 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 auto-

matically loaded into the first (MOVX) message 15 slot, allowing software to then read the second message. The CAN module deter-

mines that the first message has been read (allowing the buffered message to be transferred) when software clears the DTUP and

EXTRQ bits. If a third message arrives before the second message has been copied into the MOVX message 15 slot, then the third

message writes over the second buffered message. Software should clear the INTRQ bit, as well as the DTUP and EXTRQ bits, after

reading each message in the MOVX message 15 center. The WTOE bit associated with message center 15 has unique operating con-

siderations, described later in the section.

Transmitting and Receiving Messages

All CAN data is sent and received through message centers. All CAN message centers are identical, with the exception of message

center 15. Message center 15 has been designed as a receive-only center and is shadow-buffered to help prevent the loss of incom-

ing messages when software is unable to read one message before the next one should be loaded. All message centers, with the

exception of message center 15, are capable of four operations:

Transmitting a data message

Receiving a data message

Transmitting a remote frame request

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 properly enabled for transmission (T/R = 1, TIH = 0, DTUP = 1, MSRDY = 1, and MTRQ = 1). The con-

tents of the respective message center are then transferred to the transmit buffer, and the CAN module attempts to transmit the mes-

sage. If successful, the appropriate MTRQ bit is cleared to 0, indicating that the message was successfully sent. Following a successful

transmission, loss of arbitration, or an error condition, the CAN module again searches for a properly configured message center, start-

ing with the lowest-numbered message center. This search relationship always allows the highest priority message center to be trans-

mitted independent of the last successful (MTRQ = 0) or unsuccessful (MTRQ = 1) message transmission.

Maxim Integrated

Advertising