
Timer Control Unit
8-2
8.3
PROGRAMMABLE REGISTERS
The timers are controlled by eleven 16-bit registers (see Table 8-1) that are located in the
peripheral control block.
Table 8-1
Timer Control Unit Register Summary
The timer-count registers contain the current value of a timer. The timer-count registers
can be read or written at any time, regardless of whether the corresponding timer is running.
The microcontroller increments the value of a timer-count register each time a timer event
occurs.
Each timer also has a maximum-count register that defines the maximum value for the
timer. When the timer reaches the maximum value, it resets to 0 during the same clock
cycle. (The value in the timer-count register never equals the maximum-count register.) In
addition, timers 0 and 1 have a secondary maximum-count register. Using both the primary
and secondary maximum-count registers lets the timer alternate between two maximum
values.
If the timer is programmed to use only the primary maximum-count register, the timer output
pin switches Low for one clock cycle, the clock cycle after the maximum value is reached.
If the timer is programmed to use both of its maximum-count registers, the output pin creates
a waveform by indicating which maximum-count register is currently in control. The duty
cycle and frequency of the waveform depend on the values in the alternating maximum-
count registers.
8.3.1
Timer Operating Frequency
Each timer is serviced on every fourth clock cycle. Therefore, a timer can operate at a
maximum speed of one-quarter of the internal clock frequency. A timer can be clocked
externally at the same maximum frequency of one-fourth of the internal clock frequency.
However, because of internal synchronization and pipelining of the timer circuitry, the timer
output takes up to six clock cycles to respond to the clock or gate input.
The timers are run by the processor internal clock. If power-save mode is in effect, the
timers operate at the reduced power-save clock rate.
Offset from PCB
Register
Mnemonic
Register Name
56h
T0CON
Timer 0 Mode/Control
5Eh
T1CON
Timer 1 Mode/Control
66h
T2CON
Timer 2 Mode/Control
50h
T0CNT
Timer 0 Count
58h
T1CNT
Timer 1 Count
60h
T2CNT
Timer 2 Count
52h
T0CMPA
Timer 0 Maxcount Compare A
54h
T0CMPB
Timer 0 Maxcount Compare B
5Ah
T1CMPA
Timer 1 Maxcount Compare A
5Ch
T0CMPB
Timer 1 Maxcount Compare B
62h
T2CMPA
Timer 2 Maxcount Compare A
Summary of Contents for Am186 ES
Page 1: ...Am186 ES and Am188 ES User s Manual...
Page 4: ...iv...
Page 12: ...Table of Contents xii...
Page 22: ...Features and Performance 1 8...
Page 60: ...System Overview 3 28...
Page 84: ...Chip Select Unit 5 14...
Page 132: ...Timer Control Unit 8 8...
Page 166: ...Programmable I O Pins 11 6...
Page 184: ...Register Summary A 18...