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.

Using Shadow Registers for TMS320F28335

Other Parts Discussed in Thread: TMS320F28335, CONTROLSUITE

Hi, 

I just wanted to know if to access the registers on the TMS320F28335 I need to create shadow registers, populate those and then populate the actual register with a 32-bit word. I am not sure If I need to do it, since it is not shown in any of the example I have seen so far. 

Thanks. 

  • Marco,

    You only need to do this for the eCAN control registers (not the mailbox RAM) because they only support 32-bit writes.  Other peripherals support 16 or 32 bit writes, so you can do what you want in C or assembly.

    For the eCAN, when you do a 32-bit copy (i.e., using unsigned longs) from your "Shadow" to the actual register, the compiler is guaranteed to do a 32-bit MOVL instruction.  If you used the eCAN bitfields directly on the register, you might not get a 32-bit access.

    I believe the eCAN examples in ControlSuite use a shadow register structure.

    Regards,

    David