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.

Set F28335 eCAN transmit message time!!

Other Parts Discussed in Thread: TMS320F28335

Hi,

I'm using the TMS320F28335 chip and I want to set the transmit time of a message to 100ms. I know how to set the baud rate (I set it to 500kbps) and all. But what do I do to set the transmit message to 100ms (so, it is transmitted every 100ms?

For eg, if I send a message at say, 231.2748, I want it to send the same message again at 231.3748. How do I do this?

I'm a beginner and this is my first time programming a DSP. So, any help is much appreciated!! :)

  • I'm not an expert on CAN, but if I were to do this on the other communication channels (SCI, SPI, McBSP, etc.) I would use a timer interrupt.

    Have you looked into using the Timer0 module?  With this, you can set it to trigger an interrupt every 100ms and in that interrupt you can trigger a CAN transmit.

    If all your Timers are already allocated for something (which, I can't imagine why); you can also use an ECAP to produce timer interrupts.

  • Can I make use of the Time stamp counter register bits? Like the MOTS which stores the value of the TSC?

    can I use it like

    (if ECanaRegs.CANTSC.bit.MOTS19=100ms)

    {

    ECanaShadow.CANTRS.bit.TRS19 = 1;

    }

    to transmit the mailbox19 data?

     

    Thanks,

    VY

  • Your code will not work. CANTSC will hold the time of the last transmission.

    What you can do is to use the MOTO feature. If you load MOTO = CANLNT + 100 ms, then you can use the MOTO-Interrupt Service to start a new transmission. However, the accuracy of the CAN- Time is limited to the CAN data rate (1Mbit/s = 1 µs) , wehereas a solution based on a CPU timer wll use an accuracy of the CPU frequency (150MHz = 6.6 ns).

     

  • Hi,

    use a timer and enable an interrupt. when the DSP goes to the interrupt, start CAN transmission, reset the timer, clear the interrupt.

    alternatively, if you already have a base time, for instance PWM modulator enabled, just count the number on PWM cycles...I suppose the PWM frequency is higher than the CAN TX frequency