TMS320F2809: Missleading information on Timer_start() and Timer_stop() (using SYS/BIOS 6.83.0.18)

Part Number: TMS320F2809
Other Parts Discussed in Thread: SYSBIOS

Tool/software:

Hi everyone

I have a question regarding the SYS/BIOS timer functionality, and I’m not sure if it works as expected. I’ve found multiple documents and forum posts that all seem to say different things.

What I expect is that when I call Timer_start(), it should reset the counter of the timer and also clear all interrupt flags. If the timer was already running before, it should not stop, but simply reset. Calling Timer_stop() should stop the timer.

However, I’ve found multiple forum posts saying that Timer_start() does not reset the timer and that this behavior doesn’t work. Some documentation mentions that there was a bug in the timer module, while other sources say it never reset the timer in the first place. Then, yet another SYS/BIOS document claims that it does reset the timer.

So, what I’d like to know is:

  • What exactly do Timer_start() and Timer_stop() do?
  • What happens if I call Timer_start() when the timer is already running? Is that a problem? Do I have to call Timer_stop() first?
  • Which function call actually resets the timer, and which one clears the interrupt flags?
  • Was there indeed a bug in an earlier version of SYS/BIOS, and if so, in which version was it fixed?
  • Which is the correct documentation for SYS/BIOS version 6.83.0.18?

It would be great to get more details on this, because we have a system that isn’t 100% reliable, and we’re not sure whether the issue is with the timer module itself or the way we’re using it or something completely different.

Thank you very much.
Kind regards,
Dominik

  • You can see the Timer module code in C:\ti\bios_6_83_00_18\packages\ti\sysbios\family\c28\Timer.c

    But to summarize:

    Timer_start() does a Hwi_disable(), clears and enables the Timer Hwi, sets TCR.TIE (interrupt enable), sets TCR.TRB (reloads the timer), clears TCR.TSS (this is the timer stop bit, so clearing it starts the timer), and does a Hwi_restore(). Also, given the way the TIF bit is a write-1-to-clear bit, the read-modify-write operations performed in these other writes to TCR will clear TIF if it is set.

    Timer_stop() just sets TCR.TSS and disables the Timer Hwi.

    Do you have any more info on the bug (like the thread where it was mentioned)? I didn't find any obviously Timer related bug records, and there haven't really been any code changes to the Timer code that look like bug fixes since 2014.

    Whitney