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.

TM4C129ENCPDT: Use Timer in Periodic mode, but for one-shot application

Part Number: TM4C129ENCPDT

My application needs what is effectively a one-shot, in concept, but I also need to let the timer continue running during the interrupt so I can measure how much time after the one-shot fires until my conditions have been satisfied.

Reading the documentation, it seems apparent that I need to put the timer in Periodic Mode so that it continues running. I can then read the timer value to measure the timing of the second condition.

My problem is that I can't seem to reset the timer and start it from zero again for the second occurrence. The timer works perfectly the first time, but subsequent events look like they're random, as if the periodic timer just kept running without restarting. I'm using a logic analyzer to see the relative timing of internal and external events.

In my code, I call TimerDisable() and TimerIntClear() after I'm done with the timer.

I then call TimerIntClear(), TimerLoadSet(), TimerEnable(), and TimerIntEnable() when I want my next "one-shot."

I have the timer in _PERIODIC_UP mode, and I'm a little suspicious that this mode isn't supported.

My question is twofold:

A) What do I do with a Periodic timer to force it to stop when I'm done with my "one-shot," and especially how do I force it to start counting again from Zero when I want to repeat the process?

B) It makes most sense to me to use _PERIODIC_UP to measure the amount of time after the timer count is reached, but if that is not supported or otherwise not correct then what algorithm should I use?