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.

TM4C1230H6PM: Timers of TM4C1230H6PM

Part Number: TM4C1230H6PM


Ref. to data sheet:


Register 14: GPTM Timer A Prescale (GPTMTAPR), offset 0x038

"When in one-shot or periodic down count modes, this register acts as a true prescaler for the timer
counter. When acting as a true prescaler, the prescaler counts down to 0 before the value in the
GPTMTAR and GPTMTAV registers are incremented."

My Question is TAR and TAV are reflect the count of the free-running counter, how they increment and the timer in count down mode?

Can you elaborate how the count down here takes place?

  • Hi,

     The TAR is not a a free-running counter; the TAV is the free running counter. However, in periodic/one-shot mode you may find them to behave much the same. When you use other modes such as edge count or time count mode you will find the TAR to be a capture/snapshot register.

     When you are in periodic mode, the TAR register is first loaded with your specified preload value then it starts to count down. When the timer reaches 0 it will reload the TAR with the preload value again. This is in the case without the prescaler. With the prescaler, the prescaler counter will first count down to 0 before the TAR starts to count down.

    In periodic, snap-shot mode (TnMR field is 0x2 and the TnSNAPS bit is set in the GPTMTnMR
    register), the value of the timer at the time-out event is loaded into the GPTMTnR register and the
    value of the prescaler is loaded into the GPTMTnPS register. The free-running counter value is
    shown in the GPTMTnV register and the free-running prescaler value is shown in the GPTMTnPV
    register. In this manner, software can determine the time elapsed from the interrupt assertion to the
    ISR entry by examining the snapshot values and the current value of the free-running timer. Snapshot
    mode is not available when the timer is configured in one-shot mode