User`s guide

Introduction LZ87010 Advance User’s Guide
1-12 1/15/03
1.6.13 Counter/Timer/PWM
Six timers are provided: two standard 8051 timers (Timer 0 and Timer 1) and four
enhanced timers (Timer 2 through Timer 5). The enhanced timers use 16-bit counter/
capture/compare registers and can be configured for the following functions:
Interval timing, using either the system clock or the subclock (divided by a power of two
between 1 and 32,768) as the interval
Event timing, using an external pin as an event counter
Signal capture (timers 2 and 3 only), using the timer to record when an input signal tran-
sition takes place
Comparison, where the count is compared to a preselected value, and the result option-
ally written to an output pin
Pulse-width modulation, where the counter and compare registers are used to modulate
an output pin.
All of these functions can optionally generate an interrupt.
A one-second timer tick can be generated by selecting the 32.768 kHz subclock and
applying the maximum clock divisor of 32,768.
1.6.14 Clocks
Two input clocks are used: a high-frequency system clock in the range of 20 - 40 MHz
(XTAL1/XTAL2) and a low-frequency subclock running at 32.768 kHz (XTAL_SUB1/
XTAL_SUB2). The LZ87010 supports clock generation through crystals connected directly
to the device. See Figure 1-5. Alternatively, external clock generators can be used.
Figure 1-5. External Clock Circuitry
XTAL2
39 pF
39 pF
27 pF
27 pF
32.768 kHz
20-40 MHz
22M
XTAL1
XTAL_SUB2
LZ87010
XTAL_SUB1
LZ87010-66