Hi to everyone,
I am trying to configure individual acceptance mask filter on a FRDM-KE06Z dev-board.
Until now I accepted every frame and checked later if the frame was correct and everything was working properly. Now with multiple nodes in my system
I am using a Standard ID and I set the Individual acceptance mask to 0xFFFFFFC0 as I need only the last 6 bits to be compared (by default the mask is 0xFFFFFFFF that means all IDs can be valid).
The ID Filter Table is set to 0x00000029, the global mask cannot be enabled.
In this configuration I sent 0x28 and 0x29 as IDs, but both IDs were received.
I tried using the SetAcceptanceMaskTable and SetRxIDFilterTable methods and also tried with the 0xFF03FFFF mask (bits 29 to 18).
Can anyone post me where to find the correct bit configuration (assuming that I'm clearing the wrong bits in the acceptance mask)?
Thanks in advance.
Solved! Go to Solution.
Hi Tommaso,
Please read the KE06 reference manual carefully about the MSCAN filter.
page 638, take 32bit maskable identifier as an example:
Standard ID is 11bit, it is from IDAR1 bit 5 to bit7, and IDAR0 bit0-bit7.
So, if you want to just receive the standard ID 0X29, you need to configure it like this:
CAN_IDAR0 : 0x29<<21
IDAR0 | IDAR1 | IDAR2 | IDAR3 | ||||||||||||||||||||||||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
CAN_IDMR0 : 0X001FFFFF
IDMR0 | IDMR1 | IDMR2 | IDMR3 | ||||||||||||||||||||||||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Besides, take care,
1, is igore in filter register
0, is checking.
So, if you want to just get 0X29 standard ID, you must check every standard ID bit.
ID : 0x29<<21 =0X05200000
FILTER : 0X001FFFFF
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Yes, it helps me a lot!
Thanks!
Hi Tommaso,
Please read the KE06 reference manual carefully about the MSCAN filter.
page 638, take 32bit maskable identifier as an example:
Standard ID is 11bit, it is from IDAR1 bit 5 to bit7, and IDAR0 bit0-bit7.
So, if you want to just receive the standard ID 0X29, you need to configure it like this:
CAN_IDAR0 : 0x29<<21
IDAR0 | IDAR1 | IDAR2 | IDAR3 | ||||||||||||||||||||||||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
CAN_IDMR0 : 0X001FFFFF
IDMR0 | IDMR1 | IDMR2 | IDMR3 | ||||||||||||||||||||||||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Besides, take care,
1, is igore in filter register
0, is checking.
So, if you want to just get 0X29 standard ID, you must check every standard ID bit.
ID : 0x29<<21 =0X05200000
FILTER : 0X001FFFFF
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
P.S. I am using Kinetis Design Studio 3.0.0 with Processor Expert