Hi.
i am using Flexcan in MPC5644A
I want to receive Only ID 0x18005225, 0x18008380
So, I set Buffer[2] for Rx
and set RGXMASK to 0x7FF2C5A for filtering
But I need to use ID table to receive specific ID exactly
When I set RGXMASK to 0x7FF2C5A, I may receive ID 0x1, 0x4.....etc
there is way to use ID table or another tech for Powerful Filtering??? (I can't use RXFIFO in my environment)
Thank you.
Hi,
The MB’s ID is checked against the received one while the filtering/masking is applied.
There are following rules for filtering for different FlexCAN module configuration:
a) When MCR[FEN]=0, no RX FIFO
MCR[MBFEN]=0: MB0-MB63 use RXGMASK except MB14 uses RX14MASK and MB15 uses RX15MASK
MCR[MBFEN]=1: MB0-MB63 use RXIMR0-RXIMR63
b) When MCR[FEN]=1, RX FIFO used
MCR[MBFEN]=0: ID0-ID5 use RXGMASK, ID6 uses RX14MASK, ID7 uses RX15MASK
MB8-MB63 use RXGMASK except MB14 uses RX14MASK and MB15 uses RX15MASK
MCR[MBFEN]=1: ID0-ID7 use RXIMR0-RXIMR7, MB8-MB63 use RXIMR8-RXIMR63
The mask bit in respective mask register have following meaning.
1 = The corresponding bit in the MB’s ID is checked against the one received
0 = the corresponding bit in the MB’s ID is “don’t care”
So how do you set the MB[2] ID?
As you have so different IDs to filter the global mask will not help a lot. You will always have some range of ID that will be accepted, depending of number of don’t care bits.
I can recommend you to use the individual masking scheme and set more MBs for receiving. For example set
MB[2] ID = 0x18005225 and RXIMR2 = 0x1FFFFFFF
MB[3] ID = 0x18008380 and RXIMR3 = 0x1FFFFFFF
BR, Petr
Thank you very much
I exactly understand it.