Hi,
I am using the LPC11C24 CAN communication ,CAN can not accept the specified ID,My example comes from the official,Some of my examples are as follows:
msg_obj.msgobj = 1;
msg_obj.mode_id = 0x400 | CAN_MSGOBJ_EXT; //CAN_MSGOBJ_EXT=0x20000000
msg_obj.mask = 0x1FFFFFFF;
LPC_CCAN_API->config_rxmsgobj(&msg_obj);
while (1) {
__WFI(); /* Go to Sleep */
}
CAN can accept 0x 80000400,0x 60000400,0x40000400,0x20000400 0x400 ID.I want to accept only the specified 0x400 Extended frame ID.what should I do?
Hi ,
You can use the following code instead of the original code to receive the frame whose identifier is 0x400.
msg_obj.msgobj = 1;
msg_obj.mode_id = 0x400;
//msg_obj.mask = 0x700;
msg_obj.mask = 0x7FF;
LPC_CCAN_API->config_rxmsgobj(&msg_obj);
And the Figure 1 exemplifies the testing results.
Fig 1
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi ,
You use the standard frame, I use the expansion of the frame.you can try my code.
msg_obj.msgobj = 1;
msg_obj.mode_id = 0x400 | CAN_MSGOBJ_EXT;
msg_obj.mask = 0x7FF;
LPC_CCAN_API->config_rxmsgobj(&msg_obj);
CAN can accept 0x 80000400,0x 60000400,0x40000400,0x20000400,0x400 ID.CAN can not accept the specified 0x400 Extended frame ID.
Hi ,
Thanks for your reply.
The extended ID can't beyond the 0x1FFF_FFFF, otherwise the ID can't be recognized.
msg_obj.msgobj = 1;
msg_obj.mode_id = 0x400|CAN_MSGOBJ_EXT;
//msg_obj.mask = 0x700;
msg_obj.mask = 0x1FFFFFFF;
//msg_obj.mask = 0x7FF;
LPC_CCAN_API->config_rxmsgobj(&msg_obj);
To implement receive the specific extend ID frame, please the following code.
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
I understand, thank you very much for your answer