+ Reply to Thread
Results 1 to 7 of 7

Thread: CAN_NODE : Mask Value use case

  1. #1
    Intermediate Intermediate phab is on a distinguished road
    Join Date
    Oct 2017
    Posts
    50
    Points
    326.875

    CAN_NODE : Mask Value use case

    Hi All,

    Can anyone explain the use case of the CAN_NODE 'Mask Value' please ? What is it masking ?

    I want to receive only CAN message with ID 0x61 so I have set the 'Identifier Value' to 0x61.

    By default the 'Mask Value' is 0x7FF. Should I change this to 0x61 ?

    Click image for larger version

Name:	CAN_NODE Mask Value.jpg
Views:	3
Size:	32.6 KB
ID:	5079

    Thank you very much
    PHAB

  2. #2

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    844
    Hi,

    Check the section Receive Acceptance Filtering in the reference manual.
    ID_received XOR ID_MO AND MASK needs to evaluate to zero to accept the message.

    Click image for larger version

Name:	CAN_ID_filtering.png
Views:	3
Size:	17.6 KB
ID:	5097

    Regards,
    Jesus
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    Intermediate Intermediate phab is on a distinguished road
    Join Date
    Oct 2017
    Posts
    50
    Points
    326.875
    Hi Jesus, thanks for the reply (as usual).

    I had already read the section Receive Acceptance Filtering in the reference manual but the usage of the Acceptance Mask is not clear.

    I've tried various values for the 'Acceptance Mask' but nothing appears to have any affect on received messages.

    An example would be extremely helpful if you have one.

    Thanks again
    PHAB
    Last edited by phab; Sep 9th, 2020 at 03:40 AM.

  4. #4
    Intermediate Intermediate phab is on a distinguished road
    Join Date
    Oct 2017
    Posts
    50
    Points
    326.875
    Hi Jesus,

    OK I now understand the 'Mask'.

    A received message with an ID equal to the 'Identifier Value' defined in the Message Object will always be accepted. For example, Received ID = 0x061 and Message Object 'Identifier Value' = 0x061.
    All other received message ID's will be rejected (assuming a Mask Value of 0x7FF)

    However, if you want a wider range of received messages to be accepted by the message object you can use the 'Mask' to let more through. The 'Mask' is a 'bit' level mask.
    So if you want received messages with ID's of 0x060 and 0x061 to be accepted, CLEAR the corresponding bit(s) in the 'Mask'. For example...

    Message ID's you want accepted
    0x060 = 000 0110 0000
    0x061 = 000 0110 0001

    We don't care if the least significant received ID bit is a zero or a one so we set the least significant bit of the mask to zero...

    Mask Value
    0x7FE = 111 1111 1110


    I still have one question. What is the function of the the "Std_Ext" please ? It is not documented in the CAN_NODE Help.


    Thank you very much


    PHAB
    Last edited by phab; Oct 21st, 2020 at 02:18 PM.

  5. #5
    Intermediate Intermediate phab is on a distinguished road
    Join Date
    Oct 2017
    Posts
    50
    Points
    326.875
    The attached Excel file lets you try different CAN message ID's and Masks to see which messages are accepted or ignored.

    CAN Mask simulator 2.xlsx

  6. #6

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    844
    Hi,

    What is the function of the the "Std_Ext" please ?
    Standard message identifier has a length of 11 bits. CAN specification 2.0B extended
    the message identifier lengths to 29 bits, i.e. the extended identifier. Both frame formats
    are part of the ISO 11898-1.

    See http://www.copperhilltechnologies.co...-can-protocol/

    Regards,
    Jesus
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  7. #7
    Intermediate Intermediate phab is on a distinguished road
    Join Date
    Oct 2017
    Posts
    50
    Points
    326.875
    Hi Jesus,

    Thank you for your reply. I appreciate there are 11 and 29 bit standards which is selected by the 'Identifier Type (IDE) option, but what is the function of the the "Std_Ext" please ? It is not documented in the CAN_NODE Help. How does it affect masking ? ?

    Thank you very much
    PHAB
    Last edited by phab; Oct 28th, 2020 at 06:43 AM.

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.