S32k146 Can Rx Filter

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32k146 Can Rx Filter

1,446 Views
seop79
Contributor II

Hello
I would like to receive CAN Standard ID using Filter.

An ID (0x100 ~ 0x6FF) exists in the bus
I try to receive each filter using different filters from 0x100 to 0x1FF, 0x200 to 0x2FF, 0x300 to 0x3FF, 0x400 to 0x4FF, 0x500 to 0x5FF, and 0x600 to 0x6FF for each filter.

The example is in IDList mode, not Filter mode.

Please explain in detail.

Tags (3)
0 Kudos
Reply
1 Reply

1,141 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you can simply configure 6 message buffers for receiving and enable individual masking scheme and so configure 6 corresponding individual masking registers to allow ID range acceptation. So the init could be in this way

MB0_ID = 0x100

RXIMR0 = 0x700  // lower 8 bit are don't care

MB1_ID = 0x200

RXIMR1 = 0x700 

MB3_ID = 0x300

RXIMR3 = 0x700 

MB4_ID = 0x400

RXIMR4 = 0x700 

MB5_ID = 0x500

RXIMR5 = 0x700 

MB6_ID = 0x600

RXIMR6 = 0x700 

As the mask is the same you can also use global mask scheme and configure global mask register with 0x700.

Note: in case of standard ID the ID and mask must be shifted left by 18 bits in respective MB word or mask register. So check if you or a driver do that properly.

BR, Petr

0 Kudos
Reply