主题中讨论的其他器件:CODECOMPOSER
我在 spra876b 中提到了 can_LAM 示例、但我仍在努力地配置一个接收邮箱、可以接受所有标准(11位) msgids。
到目前为止、我已经尝试了:
//
// Disable all Mailboxes
// Required before writing the MSGIDs
//
ECanaRegs.CANME.all = 0;
// set the STDMSGIDs to anything, it doesn't matter because all
// msgids will be transmitted out on mailbox 0, and all
// msgids will be received on mailbox 1.
ECanaMboxes.MBOX0.MSGID.all = 0;
ECanaMboxes.MBOX1.MSGID.all = 0;
ECanaMboxes.MBOX0.MSGID.bit.STDMSGID = 0x649;
ECanaMboxes.MBOX1.MSGID.bit.STDMSGID = 0x648;
ECanaMboxes.MBOX1.MSGID.bit.AME = 1; // use the mbox1 acceptance mask to accept any msgid
// set the flag indicating standard msgids (11 bit) only
// IDE = 0 indicates 11 bits
ECanaMboxes.MBOX0.MSGID.bit.IDE = 0;
ECanaMboxes.MBOX1.MSGID.bit.IDE = 0;
ECanaShadow.CANMD.all = ECanaRegs.CANMD.all;
ECanaShadow.CANMD.bit.MD0 = 0; // mailbox 0 is transmit
ECanaShadow.CANMD.bit.MD1 = 1; // mailbox 1 is receive
ECanaRegs.CANMD.all = ECanaShadow.CANMD.all;
ECanaLAMRegs.LAM1.all = 0xFFFFFFFF; // set mbox 1 local acceptance mask to ignore all bits so any msgid is received
ECanaLAMRegs.LAM1.bit.LAMI = 0; // mbox 1 IDE bit should determine that only 11 bit msgids should be accepted
//
// Enable Mailboxes 0, and 1
//
ECanaShadow.CANME.all = 0x00000000;
ECanaShadow.CANME.bit.ME0 = 1;
ECanaShadow.CANME.bit.ME1 = 1;
ECanaRegs.CANME.all = ECanaShadow.CANME.all;
//
// Specify that 8 bits will be sent/received
//
ECanaMboxes.MBOX0.MSGCTRL.bit.DLC = 8;
ECanaMboxes.MBOX1.MSGCTRL.bit.DLC = 8;
我能够通过复位 ECanaMbags.MBOX0.MSGID.bit.STDMSGID 的每次传输来配置单次发送邮箱(0)。
但我的接收邮箱(1)将只接收标准 msgid = 0x648。
感谢您的任何建议。
