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.

TMS320F2801 CAN bus problem

Other Parts Discussed in Thread: TMS320F2801, TMS320F2808

Hey everybody,

I am using microcontroller TMS320F2801 in welding inverter. It communicates with front panel through CAN interface.

Some processors communicate well, some just sometimes. They are not able to receive mailbox or two (or 5).

Changing processor to TMS320F2808 (which should be possible) brings more problems. No 2808 communicates properly, but each in different way. Some doesn't receive mailbox 1, some mailbox 5, etc. Looks like it's depend on ID number.

Hardware and software is the same in all devices. CAN module setting keeps the way described in users manual (but now I am not sure with anything).

Does someone have an idea whats wrong?

 

Thanks,

Tomas.

  • Tomas,

    with the few information you gave us, it is hard to point out, what is going wrong in your application. It sounds like if  the setup parameters (Bit timing, synchronisation jump width, sample point etc. ) are at the edge. Do you get any error  frames?  Where is your sample point? What I would do is to use a CAN - Analyzer to monitor the data traffic, including error frames.

    The CAN setup depends stronly on the physical layer (cable length, stubs, reflections, etc.) and the examples in the manuals are just for orientation, they must be fitted to the individual physical layout.

    Regards

     

  • Hey Frank,

    there is better description:

    There are 6 mailboxes configured for receiving. The problem is that some of them are not able to receive message. I'm pretty sure there is no other frame except the incoming one (I checked it by CAN-analyzer on the bus and by signal-analyzer on the DSP pin). eCAN module doesn't generate any interrupt. It's just not receiving.

    Every piece of processor has "broken" mailboxes. And sometimes it changes after reset.

    Changing communication frequency (500kHz to 250kHz) or sample point (80% to 60%) make no difference.

     

    I don't relay know that to try. Any idea?

     

    Regards,

    Tomas.

  • Tomas,

    just to make sure that I understand your setup: 

    You use 1 DSP for CAN-Receceive. In this DSP you use 6 mailboxes for receiving, right?

    Are the 6 mailboxes programmed for the same or for different identifiers?

    Do you use local Acceptance masks?

    If the mailboxes are setup for the same identifier, how do you initialize the overwrite protection control register? 

    When one mailbox has received a message, how do you deal with the message? Could it be that you by chance change some bits of other mailboxes in this procedure?

    Regards

     

     

     

     

  • Hey Frank,

    yes, there is one DSP used for CAN communication. 6 mailboxes for receiving and 3 for transmitting. DSP transmits data just on demand (there is no collision).

    Every mailbox has its own identifier. Acceptance mask is not used.

    Incoming messages are handled in a short interrupt.

    Procedures and interrupt routines change just the right registers. I've just checked it. Good shot anyway.

    Now I am searching about some possible hardware differences between boards. I have 7 PCBs: 2 are working properly, 2 stop communicating after reset sometimes and 3 have some receiving problem every start.

    But DSP input signals are correct (I checked them before). So, I don't know what to look for. It's a desperate attempt ...

     

    Cheers.

  • Good Morning,

     

    I finally solved the problem. The mistake was in mailbox initialization.

    Setting registers CANME and CANMD has to be made in tree steps (copy to temporary register, change, and then write back).

    ECanaShadow.CANMD.all = ECanaRegs.CANMD.all;
    ECanaShadow.CANMD.bit.MD10 = 0;
    ECanaRegs.CANMD.all = ECanaShadow.CANMD.all;

    Tree weeks full of board and software changing, testing, forums reading and TI-support consulting didn't find this stupid error.

    Small mistakes are most difficult to find out ... :-).

     

    Cheers!

    Tomas.