cancel
Showing results for 
Search instead for 
Did you mean: 

SPC560B Flex CAN Flites

Jason Ren
Associate II

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

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
3 REPLIES 3
DCARR
Associate III

Hi,

please configure the filter as below:

ID = 0x00123456

mask = 0x0000FFF0

Best regards

Domenico

Jason Ren
Associate II

Dear Domenico

Thank you very much for your reply

I only found mask in the configuration interface

Where should I configure the ID

0693W00000KdMmtQAF.png

DCARR
Associate III

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