On the CAN, continuous transmission of multi-frame data, the need to increase the delay function。

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

On the CAN, continuous transmission of multi-frame data, the need to increase the delay function。

1,734 次查看
jia_xuan
Contributor I

If there is no delay function, can only send first frame out。


SendCANData(TX_MAILBOX, 0x01000001, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000002, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000003, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000004, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000005, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x010000A1, canbuf, 8);
delay(100);

Please help me.

Thank you.

Best Regards.

0 项奖励
回复
2 回复数

1,553 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

If using the same MB for transmissions, then you must be sure the MB is successfully transmitted before you are going to fill it again. So instead of delay you can use driver function FLEXCAN_DRV_GetTransferStatus, for example as

 

/* Wait until the previous FlexCAN transmit is completed */

while(FLEXCAN_DRV_GetTransferStatus(FSL_CANCOM1, TX_MAILBOX) == STATUS_BUSY);

BR, Petr

1,553 次查看
jia_xuan
Contributor I

Think you

0 项奖励
回复