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.

CAN registers question

Other Parts Discussed in Thread: TMS320F2808

I am using the TMS320F2808 dsp and I have found something interesting in one of your supplied source files "DSP280x_ECan.c"  In the comments it reads:

/* Create a shadow register structure for the CAN control registers. This is
 needed, since, only 32-bit access is allowed to these registers. 16-bit access
 to these registers could potentially corrupt the register contents. This is
 especially true while writing to a bit (or group of bits) among bits 16 - 31 */
I was not able to find this information in the CAN user guide or the 2808 data sheet but I believe the comments are true.  Strange things are happing to the CAN registers and I think it has something to do with this.  In the comments it says "only 32 bit access", does this me read and write access or just write access?
Also, I have noticed that the RTR bit in the MSGCTRL register will reset back to 0 after I set the TRS bit in the CANTRS register.  Is this normal or do you think it could be caused from the issue I mentioned above.  I would appreciate any help you could give me.  Thanks.
  • The 32-bit read/write requirement is mentioned in Page 15 of SPRUEU0 (1.3.2.1 32-bit Access to Control and Status Registers). It is applicable for both read & write.

     

    When you set the TRS bit, did you notice a remote frame going out? That is the indication that your write was successful. If your write didn't go through correctly, you wouldn't see a remote frame.