Skip to main content
Jason Ren
Associate
March 21, 2022
Question

SPC560B Flex CAN Flites

  • March 21, 2022
  • 3 replies
  • 1335 views

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 topic has been closed for replies.

    3 replies

    DCARR
    Visitor II
    March 21, 2022

    Hi,

    please configure the filter as below:

    ID = 0x00123456

    mask = 0x0000FFF0

    Best regards

    Domenico

    Jason Ren
    Jason RenAuthor
    Associate
    March 21, 2022

    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
    Visitor II
    March 21, 2022

    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