2022-03-20 07:55 PM
I am configuring the receiving filter of Flex CAN
How to make it recognize only part of the ID
For example, the receiving ID is 0x123456
You only need to identify 345 to consider the match successful
2022-03-21 02:07 AM
Hi,
please configure the filter as below:
ID = 0x00123456
mask = 0x0000FFF0
Best regards
Domenico
2022-03-21 02:20 AM
Dear Domenico
Thank you very much for your reply
I only found mask in the configuration interface
Where should I configure the ID
2022-03-21 03:09 AM
Hi,
in the SPC5 example the global mask is used for filtering and so, when you open the visual filter config you will see the two ID (0x8901234 and 0x1234567) and the mode (standard or extended). The mask in the example is one for all the MB and is set to 0x0FFFFFFF.
If you want to modify the mask you have to modify the driver code in function "can_lld_start" in file 'can_lld.c'. You will find the following code line where the global mask value is set:
canp->flexcan->RXGMASK.R = 0x0FFFFFFF;
If you want to use individual mask registers you have to reset to zero the BCC field in MCR register and then configure RX Buffers and relative individual masks.
Best regards
Domenico