General-Purpose Timers
17-4
Élan™SC520 Microcontroller User’s Manual
17.5.2
GP Timer 2
GP Timer 2 is a 16-bit timer that is not connected to any external pins. GP Timer 2 can be
used by software to generate interrupts, or it can be polled for real-time coding and time-
delay applications. It can also be enabled as a prescaler for GP Timer 0 and GP Timer 1.
The source clock for GP Timer 2 is always one-fourth of the Am5
x
86 CPU clock frequency.
17.5.3
Operating Modes
17.5.3.1
Interrupt on Terminal Count Mode
In this mode, an interrupt request is generated when the timer count value reaches a GP
Timer Maxcount Compare register value. This is configured with the INT_ENB bit in the
GP Timer x Mode/Control (GPTMRxCTL) register.
If continuous mode is enabled, the interrupt request pulse is generated continuously at a
regular interval time, and the interval duration depends on the value in the GP Timer
Maxcount Compare register.
17.5.3.2
Hardware Retrigger Mode
In hardware retrigger mode, a 0-to-1 edge transition on the TMRIN1 or TMRIN0 input pin
resets the existing GP Timer x Count (GPTMRxCNT) register value, for their respective
timers, and then counting continues. This mode is enabled by setting the RTG bit to 1 and
clearing the EXT_CLK bit to 0 in the GP Timer x Mode/Control (GPTMRxCTL) register.
17.5.3.3
Alternate Compare Mode
Using both the primary GP Timer x Maxcount Compare A (GPTMRxMAXCMPA) register
and the secondary GP Timer x Maxcount Compare B (GPTMRxMAXCMPB) register lets
the timer alternate between two maximum values. This mode is enabled with the ALT_CMP
bit in the GP Timer x Mode/Control (GPTMRxCTL) register.
In alternate compare mode, the TMROUT0 or TMROUT1 pin is High while the counter is
counting and being compared to the GP Timer x Maxcount Compare A
(GPTMRxMAXCMPA) register. The timer output pin is Low while the counter is counting
and being compared to the GP Timer x Maxcount Compare B (GPTMRxMAXCMPB)
register.
17.5.3.4
Square Wave Mode
In this mode, the TMROUT0 or TMROUT1 pin creates a waveform by indicating which of
the two GP Timer Maxcount Compare registers is currently in control. The duty cycle and
frequency of the waveform depend on the values in the alternating GP Timer Maxcount
Compare register. This mode is enabled when both the ALT_CMP and the CONT_COMP
bits are set in the GP Timer x Mode/Control (GPTMRxCTL) register.
17.5.3.5
Continuous Mode
In continuous mode, the GP Timer x Count (GPTMRxCNT) register is reset to 0 after it
reaches the value in the GP Timer x Maxcount Compare register value (A or B), and the
timer immediately begins counting again. Continuous mode is enabled by setting the
CONT_CMP bit in the GP Timer x Mode/Control (GPTMRxCTL) register.
17.5.3.6
Prescaler Mode
The internal output of GP Timer 2 can be used as the input clock source for GP timers 0
and 1. When the PSC_SEL bit is set in the GP Timer x Mode/Control (GPTMRxCTL) register,
timers 0 and 1 can be prescaled by GP Timer 2. This allows either or both GP Timer 0 and
GP Timer 1 to be cascaded as a 32-bit timer. The PSC_SEL bit is ignored when external
clocking is enabled (i.e., when the EXT_CLK bit is set).
Содержание Elan SC520
Страница 1: ...lan SC520 Microcontroller User s Manual Order 22004A...
Страница 4: ...iv lan SC520 Microcontroller User s Manual...
Страница 28: ...Introduction xxviii lan SC520 Microcontroller User s Manual...
Страница 42: ...Architectural Overview 1 14 lan SC520 Microcontroller User s Manual...
Страница 78: ...System Initialization 3 22 lan SC520 Microcontroller User s Manual...
Страница 108: ...Clock Generation and Control 5 10 lan SC520 Microcontroller User s Manual...
Страница 118: ...Reset Generation 6 10 lan SC520 Microcontroller User s Manual...
Страница 148: ...System Arbitration 8 24 lan SC520 Microcontroller User s Manual...
Страница 214: ...SDRAM Controller 10 36 lan SC520 Microcontroller User s Manual...
Страница 230: ...Write Buffer and Read Buffer 11 16 lan SC520 Microcontroller User s Manual...
Страница 288: ...GP Bus DMA Controller 14 22 lan SC520 Microcontroller User s Manual...
Страница 316: ...Programmable Interval Timer 16 8 lan SC520 Microcontroller User s Manual...
Страница 328: ...Software Timer 18 4 lan SC520 Microcontroller User s Manual...
Страница 346: ...Real Time Clock 20 12 lan SC520 Microcontroller User s Manual...
Страница 360: ...UART Serial Ports 21 14 lan SC520 Microcontroller User s Manual...
Страница 414: ...AMDebug Technology 26 8 lan SC520 Microcontroller User s Manual...