I'm using TCAN4550 with Arduino MEGA2560. When I working with SID, I'm receiving data well. But when I configure the XID filter the Interrupt won't fire up. I think XID filter doesn't work properly.
I referred the TCAN4550 demo code. It seems to be any issue with the code. I have attached the code here
/* Setup filters, this filter will mark any message with ID 0x055 as a priority message */
// TCAN4x5x_MCAN_SID_Filter SID_ID = {0};
// SID_ID.SFT = TCAN4x5x_SID_SFT_CLASSIC; // SFT: Standard filter type. Configured as a classic filter
// SID_ID.SFT = TCAN4x5x_SID_SFT_RANGE; // Range Filter. SFID1 holds the start address, and SFID2 holds the end address. Any address in between will match
// SID_ID.SFEC = TCAN4x5x_SID_SFEC_STORERX0; // Standard filter element configuration, store it in RX fifo 0 as a priority message
// SID_ID.SFID1 = 0x10; // SFID1 (Classic mode Filter)
// SID_ID.SFID2 = 0x7FF; // SFID2 (Classic mode Mask)
// TCAN4x5x_MCAN_WriteSIDFilter(0, &SID_ID); // Write to the MRAM
/* Store ID 0x12345678 as a priority message */
TCAN4x5x_MCAN_XID_Filter XID_ID = {0};
//XID_ID.EFT = TCAN4x5x_XID_EFT_CLASSIC ;
XID_ID.EFT = TCAN4x5x_XID_EFT_RANGE ; // EFT
XID_ID.EFEC = TCAN4x5x_XID_EFEC_PRIORITYSTORERX0; // EFEC
XID_ID.EFID1 = 0xCFF0308; // EFID1 (Classic mode filter)
XID_ID.EFID2 = 0xCFF1008; // EFID2 (Classic mode mask)
TCAN4x5x_MCAN_WriteXIDFilter(1, &XID_ID); // Write to the MRAM
When I use the XID filter I comment out the SID filter. What I need is I want to use an XID filter to filter ID's in the range of 0xCFF0308