Programmable timers, 1 16-bit timers, Ptional – Maxim Integrated High-Speed Microcontroller User Manual
Page 118: Unctions, Figure 10-3. i/o port timing for mov instruction, Er is fully described in section, Softwa

High-Speed Microcontroller User’s Guide
Rev: 062210
118 of 176
11. PROGRAMMABLE TIMERS
All members of the high-speed microcontroller family incorporate three 16-bit programmable timers and
some also have a watchdog timer with a programmable interval. Because the watchdog timer is
significantly different from the other timers, it is described separately. The 16-bit timers are referred to
simply as timers.
In most modes, the timers can be used as either counters of external events or timers. When functioning
as a counter, 1-to-0 transitions on a port pin are monitored and counted. When functioning as timers, they
effectively count oscillator cycles. The time base for the timer function is the main oscillator clock
divided by either 4 or 12. This selection is described below. Because each clock pulse must be sampled
high for one machine cycle and low for one machine cycle to be recognized, this sets the maximum
sampling frequency on any timer input at 1/8 of the main oscillator frequency.
The three timers are compatible with the 80C32. That is, they offer the same controls and I/O functions
that were available in the 80C32. As mentioned above, the actual timing of these functions is user
selectable to be compatible with the machine cycle of the older generation of 8051 family (12 clocks per
tick) or the new generation (4 clocks per tick). The timing for each of the three timers can be selected
independently and can be changed dynamically. Each timer has 4 primary modes as discussed below.
The watchdog timer reset provides CPU monitoring by requiring software to clear the timer before the
user-selected interval expires. If the timer is not cleared, the watchdog resets the CPU. The watchdog
function is optional and is described below. Since the high-speed microcontroller timers have a variety of
features, the following summary table shows the capabilities.
TIMER 0
TIMER 1
TIMER 2
13-Bit Timer/Counter
13-Bit Timer/Counter
16-Bit Timer/Counter
16-Bit Timer/Counter
16-Bit Timer/Counter
16-Bit Timer With Capture
8-Bit Timer with Auto-
Reload
8-Bit Timer with Auto-Reload
16-Bit Auto-Reload Timer/Counter
Two 8-Bit Timer/Counters
External Control Pulse
Timer/Counter
16-Bit Up/Down Auto-Reload
External Control Pulse
Timer/Counter
Baud-Rate Generator
Timer/Counter
Baud-Rate Generator
Timer Output Clock Generator
11.1 16-Bit Timers
Timers 0 and 1 are nearly identical. Timer 2 has several additional features such as up/down counting,
capture values and an optional output pin that make it unique. Timers 0 and 1 are described first. Timer 2
is described separately. As mentioned above, the time base for each timer can be varied and this is also
discussed in more detail below.
Timer 0 and Timer 1 have four operating modes. They are 13-bit timer/counter, 16-bit timer/counter, 8-bit
timer/counter with auto-reload, and two 8-bit timers. The latter mode is available to Timer 0 only. These
modes are controlled by the
register. Each timer can also serve as a counter of external pulses
(1-to-0 transition) on the corresponding Tn pin. This selection is controlled by the
other option is to gate the timer/counter using an external control signal. This allows the timer to measure
the pulse width of external signals. Timers 0 and 1 are enabled using the
register, which is also the