Part Number: TMS320F28069M
Other Parts Discussed in Thread: CODECOMPOSER
I've referred to the CAN_LAM example in spra876b, but I'm still struggling to get a single receive mailbox configured that will accept all standard (11-bit) msgids.
So far I've tried:
//
// 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;
I was able to configure the single transmit mailbox (0) by resetting the ECanaMboxes.MBOX0.MSGID.bit.STDMSGID with every transmission.
But my receive mailbox (1) will only receive standard msgid = 0x648.
Thank you for any suggestions.
