English
Language : 

LM3S5P36 Datasheet, PDF (462/1050 Pages) Texas Instruments – Stellaris® LM3S5P36 Microcontroller
General-Purpose Timers
After the match value is reached, the counter is then reloaded using the value in GPTMTnILR and
GPTMTnPR registers, and stopped because the GPTM automatically clears the TnEN bit in the
GPTMCTL register. Once the event count has been reached, all further events are ignored until
TnEN is re-enabled by software.
Figure 10-3 on page 462 shows how Input Edge-Count mode works. In this case, the timer start
value is set to GPTMTnILR =0x000A and the match value is set to GPTMTnMATCHR =0x0006 so
that four edge events are counted. The counter is configured to detect both edges of the input signal.
Note that the last two edges are not counted because the timer automatically clears the TnEN bit
after the current count matches the value in the GPTMTnMATCHR register.
Figure 10-3. Input Edge-Count Mode Example
Count
Timer stops,
flags
asserted
Timer reload
on next cycle Ignored
Ignored
0x000A
0x0009
0x0008
0x0007
0x0006
Input Signal
10.3.2.4
Input Edge-Time Mode
Note:
For rising-edge detection, the input signal must be High for at least two system clock periods
following the rising edge. Similarly, for falling edge detection, the input signal must be Low
for at least two system clock periods following the falling edge. Based on this criteria, the
maximum input frequency for edge detection is 1/4 of the system frequency.
The prescaler is not available in 16-Bit Input Edge-Time mode.
In Edge-Time mode, the timer is configured as a 16-bit down-counter. In this mode, the timer is
initialized to the value loaded in the GPTMTnILRregister. The timer is capable of capturing three
types of events: rising edge, falling edge, or both. The timer is placed into Edge-Time mode by
setting the TnCMR bit in the GPTMTnMR register, and the type of event that the timer captures is
determined by the TnEVENT fields of the GPTMCTL register. Table 10-8 on page 462 shows the
values that are loaded into the timer registers when the timer is enabled.
Table 10-8. Counter Values When the Timer is Enabled in Input Event-Count Mode
Register
TnR
TnV
Count Down Mode
GPTMTnILR
GPTMTnILR
Count Up Mode
Not available
Not available
462
January 21, 2012
Texas Instruments-Production Data