FRDM-MKE06Z MSCAN Recieve All

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FRDM-MKE06Z MSCAN Recieve All

2,085 Views
stevenlutz
Contributor III

I have started with the mscan_loopback demo on the FRDM-MKE06Z and removined the code for transmit. 
I would now like to recieve frames from any can-id. 

I suspect that I need to cahnge something with the following
mscanConfig.filterConfig.u32IDAR0
mscanConfig.filterConfig.u32IDAR1
mscanConfig.filterConfig.u32IDMR0
mscanConfig.filterConfig.u32IDMR1

 

But I don't understand how these lines work for what to set them to allow everything to bel recieved

 

 

0 Kudos
Reply
6 Replies

2,068 Views
stevenlutz
Contributor III

.

0 Kudos
Reply

2,075 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Steven,

Recommend you to read this AN12355 Using MSCAN on KE16Z MCU, it should be able to help you understand it.

MSCAN identifier acceptance filter and mask filter.png

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

2,064 Views
stevenlutz
Contributor III

Thanks Robin,
I have tried extensively to understand this.
my problem is that I want to only allow CAN ID's that include a PGN of: 0x1F801
An example ID would be 0x9F80102
I currently have the acceptance register and mask set to the following:
AR set to: 7FF803FF
MR set to: 7FF801FF



My test incoming can ID of 09F80102 is passing the filters while others are not coming in as expected. However I'm not confident this is correct all future cases including 1F801 will pass.
Can you please verify and let me know if there is something that I should do different to exclusively allow can frames with at PGN on 1F801? Thank you

Thank you

0 Kudos
Reply

2,045 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please try to use:

#define NODE_ID1 0x1F80100
#define MSCAN_IDMR0 ~((uint32_t)(MSCAN_RX_MB_EXT_MASK(NODE_ID1)))
#define MSCAN_IDMR1 ~((uint32_t)(MSCAN_RX_MB_EXT_MASK(NODE_ID1)))

0 Kudos
Reply

2,037 Views
stevenlutz
Contributor III

Can you explain the MSCAN_RX_MB_EXT_MASK function?

0 Kudos
Reply

2,031 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

It's MsCAN Rx Message Buffer Mask helper macro.

MsCAN Rx Message Buffer Mask helper macro.png

It converts CAN ID into Message Buffer format.

2.3.2.1 In the mode of two 32-bit identifier filters.png

Figure 2. Standard data frame and extended data frame.png

0 Kudos
Reply