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.

TMS320F2812 CAN Configure Reception Mailbox



hello

here is my coonfiguration code for the mailbox zero as receiving:

 

void ConfigMailBox_0_RX()
{   
    // configure reception mailbox0
    ECanaRegs.CANME.bit.ME0 = 0; // disable mailbox 0   
   
        // set local acceptance mask   
        ECanaLam.LAM0.bit.LAM_H = 0x000;
       
        // set standard identifier
        //ECanaMboxes.MBOX0.MID.bit.MSGID_H = 0x000 << 2;
        ECanaMboxes.MBOX0.MID.all = 0;
       
        ECanaMboxes.MBOX0.MID.bit.IDE = 0;    // configure to Standard Identifier

ECanMboxShadow.MBOX2.MID.bit.AAM = 0;   // auto answer mode off

    ECanaMboxes.MBOX0.MID.bit.AME = 0;    // enable-1/disable-0 the usage of the acceptance mask

    ECanaRegs.CANMD.bit.MD0 = 1;       // Config as receive mailbox
       
    ECanaRegs.CANME.bit.ME0 = 1;    // enable mailbox 0
}

 

the issue that i have is that i'm receiving just messages with the 0x000 ID.

how do i set it up for receiving all the ID's?

 

thanks

  • It looks like your local acceptance mask is set to all zeros.  This means the ID on the received message has to exactly match the mailbox ID. 

    Set bits 28:0 to ones to allow all messages. 

    See "2.20 Acceptance Filter" in the eCan reference (SPRUGL7)

  • hey, i resolved the issue with an 7FF in LAM0:

     

    void ConfigMailBox_0_RX()
    {    
        // configure reception mailbox0
        ECanaRegs.CANME.bit.ME0 = 0; // disable mailbox 0    
        
            // set local acceptance mask    
            ECanaLam.LAM0.bit.LAM_H = 0x7FF;
            
            // set standard identifier
            //ECanaMboxes.MBOX0.MID.bit.MSGID_H = 0x000 << 2;
            ECanaMboxes.MBOX0.MID.all = 0x000;
            
            ECanaMboxes.MBOX0.MID.bit.IDE = 0;    // configure to Standard Identifier

        //ECanaMboxes.MBOX2.MID.bit.AAM = 0;   // auto answer mode off
        
        //ECanaRegs.CANGAM.all = 1; //Global Acceptance Mask Register

        ECanaMboxes.MBOX0.MID.bit.AME = 1;    // enable-1/disable-0 the usage of the acceptance mask

        ECanaRegs.CANMD.bit.MD0 = 1;       // Config as receive mailbox
            
        ECanaRegs.CANME.bit.ME0 = 1;    // enable mailbox 0
    }