S9KEAZ64AMLK the AcceptanceMask and IDFilter do not work

cancel
Showing results for 
Search instead for 
Did you mean: 

S9KEAZ64AMLK the AcceptanceMask and IDFilter do not work

151 Views
Contributor I

KDS 3.2.0 project built by ProcessorExpert. When initializing CANBus I install a mask and a filter:

void InitCAN()

{

     MyCANPtr = CAN1_Init(NULL);

     CAN1_Disable(MyCANPtr);

     Error = CAN1_SetAcceptanceMaskTable(MyCANPtr, 0U, 0xFFFF0000 );

     Error = CAN1_SetRxIDFilterTable(MyCANPtr, 0U, 0xFFFFF102);  // not work with ID: 0x18DAF102

     Error = CAN1_SetRxIDFilterTable(MyCANPtr, 0U, 0xFFFFE204);  // that's how it works, but why?

     CAN1_Enable(MyCANPtr);

}


Does not work. I found a solution, but it only works on the last two bytes. In the debate registers, I see the correct values I set.

This seems to be a microcontroller problem. But I haven't found any errata on this topic anywhere.
Perhaps the specialists from Freescale can clarify something?

2 Replies

8 Views
NXP TechSupport
NXP TechSupport

Hello Vladimir,

Bellow I will try to explain how the filters work.

If you check the table in the 32-77 it explains how to use the 32 bit mode filtering:

pastedImage_1.png

So if you want to filter 0x18DAF102 you will need to write the register IDAR with the following values:

IDAR0IDAR1IDAR2IDAR3
2827262524232221201918SRRIDE17161514131211109876543210RTR
11000110110111011110001000000100
C6DDE24

The IDMR register is to select which bits of the IDARx filter will be marked as "don't care". So for example if you want to allow more than 1 ID with a single filter, for example, 0x18DAF103 and 0x18DAF102, you will need to write the IDMrx registers with the following values.

IDMR0IDMR1IDMR2IDMR3
2827262524232221201918SRRIDE17161514131211109876543210RTR
00000000000000000000000000000010
0002

Let me know if this helps you..

Best Regards,

Alexis Andalon

8 Views
Contributor I

Hello Alexis,

Thank you so much!

You helped me a lot. I get it now.

Best Regards,

Vladimir Medvedev

0 Kudos