TI E2E 英文论坛海量技术问答的中文版全新上线,可点击相关论坛查看,或在站内搜索 “参考译文” 获取。

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F280025C: CAN的message object只能收一次資料

Part Number: LAUNCHXL-F280025C
Other Parts Discussed in Thread: C2000WARE

Hello,

參考了"can_ex5_simple_receive", 實作以下一個簡單的CAN bus receive data,

設定好一個message object後, 只能接收一次data, 想請問是甚麼原因造成的?

#define RX_MSG_OBJ_ID    1

uint16_t rxMsgData[8];

void main(void)
{

Device_init();


Device_initGPIO();
GPIO_setPinConfig(DEVICE_GPIO_CFG_CANRXA);
GPIO_setPinConfig(DEVICE_GPIO_CFG_CANTXA);


CAN_initModule(CANA_BASE);


CAN_setBitRate(CANA_BASE, DEVICE_SYSCLK_FREQ, 500000, 20);


CAN_setupMessageObject(CANA_BASE, RX_MSG_OBJ_ID, 0x1,
CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0,
CAN_MSG_OBJ_FIFO, 0);


CAN_startModule(CANA_BASE);


while(1)
{
if(((HWREGH(CANA_BASE + CAN_O_ES) & CAN_ES_RXOK)) == CAN_ES_RXOK)
{



CAN_readMessage(CANA_BASE, RX_MSG_OBJ_ID, rxMsgData);

rxMsgCount++;
}
}