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.

TMS320F2808: CAN Auto Answer behavior

Part Number: TMS320F2808

I have come across a behavior I cannot explain. It seems that MSGID.bit.AAM only works if the defined transmit mailbox is 16 - 31.

The example below works as I can send a CAN message to the F2808 with ID of 5 and I get an auto answer. Note that MBOX2 is Rx and MBOX28 is Tx

However, if I make MBOX28 Rx and MBOX2 Tx as well as "ECanaRegs.CANMD.all = 0xFFFF0000;" to swap Rx an Tx directions and use CANTA.bit.TA2, I no longer get an auto answer. I have tired other MBOX combinations but only Tx mailboxes in the 0 - 15 range work. Any thoughts?

// Receive
ECanaMboxes.MBOX2.MSGID.bit.STDMSGID = 5;
ECanaMboxes.MBOX2.MSGID.bit.IDE = 0;
ECanaMboxes.MBOX2.MSGID.bit.AAM = 0;
ECanaMboxes.MBOX2.MSGCTRL.bit.DLC = 8;
// Transmit
ECanaMboxes.MBOX28.MSGID.bit.STDMSGID = 5;
ECanaMboxes.MBOX28.MSGID.bit.IDE = 0;
ECanaMboxes.MBOX28.MSGID.bit.AAM = 1;
ECanaMboxes.MBOX28.MDL.all = 0x28282828;
ECanaMboxes.MBOX28.MDH.all = 0x28282828;

/* Enable appropriate Mailboxes in CAN-A*/
ECanaRegs.CANME.all = 0xFFFFFFFF;

/* Configure CAN-A Mailboxes as RX (1) and TX (0)*/
ECanaRegs.CANMD.all = 0x0000FFFF;

while(1)
{
do {ECanaShadow.CANTA.all = ECanaRegs.CANTA.all;} // Wait for TA28 bit to be set..
while(ECanaShadow.CANTA.bit.TA28 == 0);

if(ECanaShadow.CANTA.bit.TA28)
{
ECanaShadow.CANTA.all = 0;
ECanaShadow.CANTA.bit.TA28 = 1; // Clear TA28
ECanaRegs.CANTA.all = ECanaShadow.CANTA.all;
// Update the mailbox data
ECanaMboxes.MBOX28.MDL.all += 3;
}
}

  • I presume you are using the self-test mode. Could you please transmit the remote frame from an external node? Also please examine the value of the MSGID register in the memory window.

  • The code running is not in self test mode (CANMC.STM = 0). I have the InnoMaker USC2Can tool running on laptop. (Laptop hangs while grabbing screen shots for supporting information.)

    ARGH!

    In the process of grabbing screen shots, my laptop hung so I needed to reboot. Following the reboot, the issue no longer exists. CAN AA is now working for any transmit mbox 0 - 31. 

    Sorry for the false alarm.