RT1052 FLEXCAN for some (for example,five) IDs communication

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

RT1052 FLEXCAN for some (for example,five) IDs communication

跳至解决方案
1,547 次查看
FromCH0
Contributor II

In https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RT1052-FLEXCAN-for-any-ID-communication/t... ,you tell us how to use RT1052 FLEXCAN for any IDs communication.However, I need to know how to use RT1052 FLEXCAN for five or so different IDs (for example,0x18554400,0x18557800,0x18214400,0x13557800,0x10554400)communication and thus the other IDs communication will not performed.

0 项奖励
回复
1 解答
1,534 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  @FromCH0 ,

   Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

    If you need more ID filter, then you can use more MB, then set the individual MASK for the related MB,

   You can check the SDK API: 

void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask)

  Define the different MB, then configure the related mask, then it will just receive your defined IDs.

 

Wish it helps you!

Best Regards,

Kerry

 

Wish it helps you!

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,535 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  @FromCH0 ,

   Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

    If you need more ID filter, then you can use more MB, then set the individual MASK for the related MB,

   You can check the SDK API: 

void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask)

  Define the different MB, then configure the related mask, then it will just receive your defined IDs.

 

Wish it helps you!

Best Regards,

Kerry

 

Wish it helps you!

0 项奖励
回复
1,530 次查看
FromCH0
Contributor II

Than you very much!I'll try.

0 项奖励
回复
1,528 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @FromCH0 ,

  You are welcome!
   If you have issues, just let me know.

  If your question is solved, please tell me to mark the correct answer, just close this case, thanks.

 

Best Regards,

Kerry

0 项奖励
回复
1,505 次查看
FromCH0
Contributor II

mb_config_0.format=kFLEXCAN_FrameFormatExtend; //扩展帧
mb_config_0.type=kFLEXCAN_FrameTypeData; //数据帧
mb_config_0.id=FLEXCAN_ID_EXT(can2_rxid_0); //接收的帧ID
FLEXCAN_SetRxMbConfig(CAN2,8,&mb_config_0,true);


mb_config_1.format=kFLEXCAN_FrameFormatExtend; //扩展帧
mb_config_1.type=kFLEXCAN_FrameTypeData; //数据帧
mb_config_1.id=FLEXCAN_ID_EXT(can2_rxid_1); //接收的帧ID
FLEXCAN_SetRxMbConfig(CAN2,10,&mb_config_1,true);

 

FLEXCAN_SetRxIndividualMask(CAN2,8,FLEXCAN_RX_MB_EXT_MASK(can2_rxid_0,0,0));
FLEXCAN_SetRxIndividualMask(CAN2,10,FLEXCAN_RX_MB_EXT_MASK(can2_rxid_1,0,0));

以上是我的测试程序的部分内容,测试程序接收到了指定的多个ID号的数据。

感谢!