717
CAN Controller (CAN)
Chapter 19
Preliminary User’s Manual U17566EE1V2UM00
19.10.3
Mask function
It can be defined whether masking of the identifier that is set to a message
buffer is linked with another message buffer.
By using the mask function, the identifier of a message received from the CAN
bus can be compared with the identifier set to a message buffer in advance.
Regardless of whether the masked ID is set to 0 or 1, the received message
can be stored in the defined message buffer.
While the mask function is in effect, an identifier bit that is defined to be 1 by a
mask in the received message is not compared with the corresponding
identifier bit in the message buffer.
However, this comparison is performed for any bit whose value is defined as 0
by the mask.
For example, let us assume that all messages that have a standard-format ID,
in which bits ID27 to ID25 are 0 and bits ID24 and ID22 are 1, are to be stored
in message buffer 14. The procedure for this example is shown below.
<1> Identifier to be stored in message buffer
Note
x = don’t care
<2> Identifier to be configured in message buffer 14 (example)
(Using C0MIDL14 and C0MIDH14 registers)
Note
1.
ID with the ID27 to ID25 bits cleared to 0 and the ID24 and ID22 bits set to
1 is registered (initialized) to message buffer 14.
2.
Message buffer 14 is set as a standard format identifier that is linked to
mask 1 (CnMCONF14.MT2 to CnMCONF14.MT0 bits are set to 010B).
ID28
ID27
ID26
ID25
ID24
ID23
ID22
ID21
ID20
ID19
ID18
x
0
0
0
1
x
1
x
x
x
x
ID28
ID27
ID26
ID25
ID24
ID23
ID22
ID21
ID20
ID19
ID18
x
0
0
0
1
x
1
x
x
x
x
ID17
ID16
ID15
ID14
ID13
ID12
ID11
ID10
ID9
ID8
ID7
x
x
x
x
x
x
x
x
x
x
x
ID6
ID5
ID4
ID3
ID2
ID1
ID0
x
x
x
x
x
x
x
electronic components distributor