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.

TMS320F28032: Mailbox enable situation

Part Number: TMS320F28032


Hi,

CANME register is enabled  by bit,and the result affects the use of other mailboxes,code is attached.

void vYLCanIDInit(void)   //

ECanaRegs.CANME.all = 0x00000000;

ECanaMboxes.MBOX1.MSGCTRL.all = 0x00000008; 
ECanaMboxes.MBOX4.MSGCTRL.all = 0x00000008; 
ECanaMboxes.MBOX5.MSGCTRL.all = 0x00000108;

ECanaMboxes.MBOX1.MSGID.all = 0xc6900003;

ECanaRegs.CANME.all = 0x00000032; 
ECanaRegs.CANMD.all = 0x00000002; 


ECanaLAMRegs.LAM1.all = 0x81DFFFFF; 
ECanaLAMRegs.LAM4.all = 0x800FFFFC;
ECanaLAMRegs.LAM5.all = 0x800FFFFC;

}

void InfyCanIDInit(void)   //在选择此协议时初始化和通讯故障时初始化
{

ECanaRegs.CANME.bit.ME2 = 0; 
ECanaRegs.CANME.bit.ME8 = 0;

ECanaMboxes.MBOX2.MSGCTRL.all = 0x00000008;
ECanaMboxes.MBOX8.MSGCTRL.all = 0x00000008; 

ECanaMboxes.MBOX2.MSGID.all = 0xC29A00F0; 

ECanaRegs.CANME.bit.ME2 = 1; 
ECanaRegs.CANME.bit.ME8 = 1;

ECanaRegs.CANMD.bit.MD2 = 1; 
ECanaRegs.CANMD.bit.MD8 = 0; 

ECanaLAMRegs.LAM2.all = 0x807FFFFF;
}

The simulation is as follows.

your advice is useful.thank you!

  • Reading your post, I am unable to understand what your problem is. Looking at the first part of your code snippet, I see that mailboxes 4 & 5 are transmit mailboxes, but I see that you are also writing to the respective LAM registers. Acceptance mask filtering is only applicable for receive mailboxes.
     
    In the second code snippet, I see that you are not using 32-bit R/W. For example, the following statements are not permitted:
     
    ECanaRegs.CANME.bit.ME2 = 1;
    ECanaRegs.CANME.bit.ME8 = 1;
     
    ECanaRegs.CANMD.bit.MD2 = 1;
    ECanaRegs.CANMD.bit.MD8 = 0;
     
    You need to use the shadow registers to ensure all R/W are 32-bit. Please download my app.note at   and take a look at the examples. They show you how to implement 32-bit R/W and there is also one example that shows how acceptance mask filtering works.