beautypg.com

Arbitration/masking considerations, Message center 15, Rbitration – Maxim Integrated High-Speed Microcontroller Users Guide: DS80C390 Supplement User Manual

Page 141: Asking, Onsiderations

background image

High-Speed Microcontroller User’s Guide: DS80C390 Supplement

141 of 158

ARBITRATION/MASKING CONSIDERATIONS

Each CAN processor evaluates CAN bus activity to determine if an incoming message is loaded into one
of the 15 message centers. Acceptance of a message is determined by comparing the message’s ID or data
field against the corresponding arbitration value loaded into each message center and checking if the bits
match. Messages that contain bit errors or which fail arbitration are discarded. The incoming message is
tested in order against each enabled message center (enabled by the MSRDY bit in the CAN Message
Control Register) from 1 to 15. The first message center to successfully pass the test will receive the
incoming message and end the testing, and the message is loaded into the respective message center.

The CAN modules support an optional masking feature that restricts arbitration to those bits that are
masked with a 1 in the respective masking register. By selectively programming the message center
arbitration registers and the related masks, it is possible to allow groups of incoming messages to be
loaded into any single message center. Each pair of mask and arbitration registers has the same number of
bits as the message ID in the incoming message. When masking is enabled, only those arbitration and
identifier bits that correspond to a 1 in the masking register will be compared. Programming a bit in the
mask to a 0 will make the comparison of those arbitration and identifier bits a don’t care, automatically
registering a match between those bits. If all of the bits in the mask are programmed to a 0, any incoming
message arbitration field will match with any message center arbitration value. On the other hand, if a
mask is programmed with all 1’s all of the arbitration and identifier bits must match identically before the
incoming message will be loaded into the message center.

The DS80C390 supports two types of arbitration: basic and media. Basic arbitration compares either 29-
bits (

EX/

ST

=1)

or 11-bits (

EX/

ST

=0)

of the message ID against the corresponding bits in the 4 CAN

Arbitration registers (CnMxAR0-3). Each message center can be individually configured for 29- or 11-bit
operation. If the Message Identification Mask Enable bit (MEME) is set, the CAN module will utilize the
Standard Global Mask registers (CnSGM0-1) when EX/ST =0 or the Extended Global Mask registers
(CnEGM0-3) when EX/ ST

=1. In either case,

only those bits in the message ID and arbitration registers

which correspond with a 1 in the mask register will be compared. Bits corresponding with 0 in the mask
register will be ignored, creating a don’t care condition. Filling the mask register with all 0s while
MEME=1 will cause the arbitration circuitry to automatically match all message IDs. When MEME=0,
all ID bits in the incoming message are compared directly (bit for bit) with the respective arbitration bits
of the message center.

Media arbitration is an optional second arbitration performed when the Media Identification Mask Enable
bit (MDME) is set. Media arbitration compares the first and second byte of the data field in each message
against two 8-bit Media Arbitration bytes (stored at locations CnMA0, CnMA1). If the incoming
arbitration field matches a specific message arbitration value and the first two data bytes match the two 8-
bit Media Arbitration bytes (and no bit errors are detected) the message is loaded into the respective
message center. Unlike the Identification Mask Enable (MEME), however, when MDME=0 no testing
will be 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
Cn15M3-0 mask registers to perform an additional level of filtering during basic (i.e., not media)
arbitration. When determining arbitration for message center 15, the contents of Cn15M3-0 are logically
AND’ed with either CnEGM3-0 (if EX/ST =1 for message center 15) or CnSGM1-0 (if EX/ST =0 for