How to set the ID filter mask in MPC5604P?

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

How to set the ID filter mask in MPC5604P?

815 Views
ananan
Contributor III

CAN_0.MCR.B.FEN=1;

CAN_0.MCR.B.BCC=0;

CAN_0.FXGMASK.R=0x1f123000;

these are my set in the function of ID filter mask.But when the can modoule receives the value of 0x1f128000,the value of 0x1f128000 is received.the 8 of the 0x1f128000 is not match the 3 of the 0x1f123000 .why the value is teceived?  How is the ID filter mask work? How to set the ID filter mask in MPC5604P?

0 Kudos
4 Replies

512 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

How do you set elements of the RXFIFO ID table in fact? The ID table specifies filtering criteria for accepting frames into the RXFIFO.

Note there is a misalignment between the position of the ID field in the Rx MB and in RXIDA, RXIDB and RXIDC fields of the ID Tables. In fact RXIDA filter in the ID Tables is shifted one bit to the left from Rx MBs ID. This leads the RXGMASK to affect Rx MB and Rx FIFO filtering in different ways.

Thus it is recommended to used Individual Mask registers if RXFIFO is used.

The eight elements of the filter table are individually affected by the first eight Individual Mask Registers

(RXIMR0–RXIMR7). The rest of the RXIMR, starting from RXIM8, continue to affect the regular MBs, starting from MB8. If the BCC bit is negated, then the FIFO filter table is affected by the legacy mask registers as follows: element 6 is affected by RX14MASK, element 7 is affected by RX15MASK and the other elements (0 to 5) are affected by RXGMASK.

BR, Petr

0 Kudos

512 Views
ananan
Contributor III

thank you for your asking。

CAN_0.MCR.B.FEN=1;

CAN_0.MCR.B.BCC=1;

CAN_0.FXGMASK.R=0x00000000;

CAN_0.RXIMR[0].R=0x1f1230000

1,the can modoule can not receives the value of 0x1f128000 and 0x1f123000 。 But when I set the CAN_0.RXIMR[0].R=~0x1f1230000,the can modoule can not receives the value of 0x1f128000、0x1f118000、0x1f118000 and so on ,but can receives 0x1f123000、0x1f125000、0x1f225000 and so on。what is the regular about this ?

2,when the bit in CAN_0.RXIMR[0].R is set to 1 and only the alignment bit in recevied data is 0 ,the can modoule can get the data?   How is the can ID filter working ?what is it operational principle?

0 Kudos

512 Views
PetrS
NXP TechSupport
NXP TechSupport

If the RXFIFO is enabled the ID table resides in MB6-MB7 space. You have to initialize whole ID table.

Each element in ID table ( the IDs you want to receive into an RXFIFO) is affected by Mask registers in following manner

RXFIFOa.png

 

If a mask bit is asserted, then the corresponding ID bit is compared. If the mask bit is negated, the corresponding ID bit is “don’t care”.

BR, Petr

512 Views
ananan
Contributor III

thank you for your asking very much! but you said that If a mask bit is asserted, then the corresponding ID bit is compared.that is the mask bit is "1" and the corresponding ID must be "1",the CAN can recicve the ID?or the corresponding ID must be "0",the CAN can recicve the ID?

0 Kudos