General-Purpose Timers
Élan™SC520 Microcontroller User’s Manual
17-3
17.5
OPERATION
The ÉlanSC520 microcontroller includes three GP timers, each of which supports several
different operating modes.
17.5.1
GP Timer 0 and GP Timer 1
GP Timers 0 and 1 can be used to count or time external events that drive the timer input
pins and to generate a variety of waveforms on the timer output pins.
The source clock for GP Timer 0 and GP Timer 1 can be configured to be one-fourth of the
Am5
x
86 CPU clock frequency, or it can be driven from the timer external input (TMRIN0 or
TMRIN1) whose maximum clock frequency is one-fourth of the Am5
x
86 CPU clock speed.
When driven from the timer’s external input pin, the timer counts the “event” of an input
transition.
GP Timer 0 and GP Timer 1 are 16-bit timers. Each of these two timers can be cascaded
as a 32-bit timer when GP Timer 2 is configured as a prescaler by setting the PSC_SEL
bit in the GP Timer x Mode/Control (GPTMRxCTL) register. (See “Combining GP Timer
Count Elements” on page 17-6.) When they are in 32-bit mode, GP timers 0 and 1 cannot
be used as 16-bit timers.
The TMRIN0 and TMRIN1 pins can be configured to be one of many functions via the use
of the configuration bits in the respective timer registers. These functions include:
■
Clock input—Configured with the EXT_CLK bit in the GP Timer x Mode/Control
(GPTMRxCTL) register
■
Enable input—Configured with both the RTG bit and EXT_CLK bit cleared to 0 in the
GP Timer x Mode/Control (GPTMRxCTL) register
■
Reset input (hardware retrigger mode)—Configured with the RTG bit set to 1 and the
EXT_CLK bit cleared to 0 in the GP Timer x Mode/Control (GPTMRxCTL) register
GP Timer 1 Maxcount
Compare A
GPTMR1MAXC
MPA
C7Eh
Maxcount value A to compare with current count
GP Timer 1 Maxcount
Compare B
GPTMR1MAXC
MPB
C80h
Maxcount value B, used in the alternate mode
GP Timer 2 Mode/Control
GPTMR2CTL
C82h
GP Timer 2 enable, permit Enable bit write,
interrupt enable, maxcount register in use,
maximum count, continuous mode
GP Timer 2 Count
GPTMR2CNT
C84h
Current count value
GP Timer 2 Maxcount
Compare A
GPTMR2MAXC
MPA
C8Eh
Maxcount value to compare with current count
GP Timer 0 Interrupt Mapping GPTMR0MAP
D1Ah
GP Timer 0 interrupt mapping to any of 22
available interrupt channels or NMI
GP Timer 1 Interrupt Mapping GPTMR1MAP
D1Bh
GP Timer 1 interrupt mapping
GP Timer 2 Interrupt Mapping GPTMR2MAP
D1Ch
GP Timer 2 interrupt mapping
Table 17-2
General-Purpose Timer Registers—Memory-Mapped (Continued)
Register
Mnemonic
MMCR
Offset
Address
Function
Содержание 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...