cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Mask and Arbitration register

tj2
Associate II
Posted on April 18, 2006 at 04:42

CAN Mask and Arbitration register

3 REPLIES 3
tj2
Associate II
Posted on March 31, 2006 at 13:08

Hi all!

We are having some troubles with the can controller. We need to receive all identifiers within a range i.e. ID filtering.

It seems that the mask register is and'ed to the incoming identifier,

and if the result as different from 0 (zero) the package is ignored.

The arbitrary register acts realy odd.

The table below shows the resulting indentifier when the register set to 0x335D :

ID Send and ID Received

0x0000005D 0x0000005D

0x000018FF 0x000018FF

0x0000335D 0x0000335D

0x0000735D 0x0000735D

0x0007335D 0x0000335D

0x00073350 0x00003350

0x00073300 0x00003300

0x00073000 0x00003000

0x00070000 0x00000000

0x00005000 0x00005000

Is this the correct behavior? Does anyone know how the Mask register and Arbitrary register are used/works?

How do we configure them to allow a range of identifiers instead of only one?

[ This message was edited by: logic_io-TJ on 31-03-2006 16:42 ]

[ This message was edited by: logic_io-TJ on 31-03-2006 16:43 ]

davidbellegarde9
Associate II
Posted on April 12, 2006 at 13:56

Hello,

The criteria applied to keep a received frame is as follows: (received ID) AND (ID mask) = (ID arbitration), where AND is a bitwise operator.

A way to define a range by using these registers is to fill the mask one with (~((id_high) - (id_low))) and the arbitration one with ((id_low) & (id_high)).

Consequently, for id_low, it is generally better to choose a value with some LSBs cleared, and for id_high a value that “logically contains� id_low and with the same LSBs set. Example: the range 0x100-0x3FF

will work, but the range 0x100-0x2FF will not because 0x100 is not logically contained in 0x2FF (i.e. 0x100 & 0x2FF = 0).

Regards.

David B.

tj2
Associate II
Posted on April 18, 2006 at 04:42

Hi David

Thanks! I did find the answer earlier though, but thank you anyway!