Texas Instruments Development Kit for TM4C129x,Tiva™ ARM® Cortex™ -M4 Microcontroller DK-TM4C129X DK-TM4C129X 데이터 시트

제품 코드
DK-TM4C129X
다운로드
페이지 2182
GPTMTnPR registers), the timer reloads with 0x0. If configured to be a one-shot timer, the timer
stops counting and clears the
TnEN
bit in the GPTMCTL register. If configured as a periodic timer,
the timer starts counting again on the next cycle.
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. 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.
In addition to reloading the count value, the GPTM can generate interrupts, CCP outputs and triggers
when it reaches the time-out event. The GPTM sets the
TnTORIS
bit in the GPTM Raw Interrupt
Status (GPTMRIS) register (see page 1143), and holds it until it is cleared by writing the GPTM
Interrupt Clear (GPTMICR) 
register (see page 1149). If the time-out interrupt is enabled in the GPTM
Interrupt Mask (GPTMIMR) 
register (see page 1140), the GPTM also sets the
TnTOMIS
bit in the
GPTM Masked Interrupt Status (GPTMMIS) register (see page 1146). The time-out interrupt can be
disabled entirely by setting the
TACINTD
bit in the GPTM Timer n Mode (GPTMTnMR) register. In
this case, the
TnTORIS
bit does not even set in the GPTMRIS register.
By setting the
TnMIE
bit in the GPTMTnMR register, an interrupt condition can also be generated
when the Timer value equals the value loaded into the GPTM Timer n Match (GPTMTnMATCHR)
and GPTM Timer n Prescale Match (GPTMTnPMR) registers. This interrupt has the same status,
masking, and clearing functions as the time-out interrupt, but uses the match interrupt bits instead
(for example, the raw interrupt status is monitored via
TnMRIS
bit in the GPTM Raw Interrupt Status
(GPTMRIS) register). Note that the interrupt status bits are not updated by the hardware unless the
TnMIE
bit in the GPTMTnMR register is set, which is different than the behavior for the time-out
interrupt. The ADC trigger is enabled by setting the
TnOTE
bit in GPTMCTL and the event that
activates the ADC is configured in the GPTM ADC Event (GPTMADCEV) register. The μDMA
trigger is enabled by configuring and enabling the appropriate μDMA channel as well as the type
of trigger enable in the GPTM DMA Event (GPTMDMAEV) register. See “Channel
Configuration” on page 712.
The
TCACT
field of the GPTM Timer n Mode (GPTMTnMR) register can be configured to clear, set
or toggle an output on a time-out event.
If software updates the GPTMTnILR or the GPTMTnPR register while the counter is counting down,
the counter loads the new value on the next clock cycle and continues counting from the new value
if the
TnILD
bit in the GPTMTnMR register is clear. If the
TnILD
bit is set, the counter loads the
new value after the next timeout. If software updates the GPTMTnILR or the GPTMTnPR register
while the counter is counting up, the timeout event is changed on the next cycle to the new value.
If software updates the GPTM Timer n Value (GPTMTnV) register while the counter is counting up
or down, the counter loads the new value on the next clock cycle and continues counting from the
new value. If software updates the GPTMTnMATCHR or the GPTMTnPMR registers, the new values
are reflected on the next clock cycle if the
TnMRSU
bit in the GPTMTnMR register is clear. If the
TnMRSU
bit is set, the new value will not take effect until the next timeout.
If the
TnSTALL
bit in the GPTMCTL register is set and the
RTCEN
bit is not set in the GPTMCTL
register, the timer freezes counting while the processor is halted by the debugger. The timer resumes
counting when the processor resumes execution. If the
RTCEN
bit is set, it prevents the
TnSTALL
bit from freezing the count when the processor is halted by the debugger.
The following table shows a variety of configurations for a 16-bit free-running timer while using the
prescaler. All values assume a 120-MHz clock with Tc=Pending ns (clock period). The prescaler
can only be used when a 16/32-bit timer is configured in 16-bit mode.
December 13, 2013
1108
Texas Instruments-Advance Information
General-Purpose Timers