![](http://datasheet.mmic.net.cn/20000/ST72F324BJ2TATRE_datasheet_1390578/ST72F324BJ2TATRE_80.png)
Obsolete
Product(s)
- Obsolete
Product(s)
On-chip peripherals
ST72324B-Auto
10.3
16-bit timer
10.3.1
Introduction
The timer consists of a 16-bit free-running counter driven by a programmable prescaler.
It may be used for a variety of purposes, including pulse length measurement of up to two
input signals (input capture) or generation of up to two output waveforms (output compare
and PWM).
Pulse lengths and waveform periods can be modulated from a few microseconds to several
milliseconds using the timer prescaler and the CPU clock prescaler.
Some ST7 devices have two on-chip 16-bit timers. They are completely independent, and
do not share any resources. They are synchronized after a MCU reset as long as the timer
clock frequencies are not modified.
This description covers one or two 16-bit timers. In ST7 devices with two timers, register
names are prefixed with TA (Timer A) or TB (Timer B).
10.3.2
Main features
●
Programmable prescaler: fCPU divided by 2, 4 or 8
●
Overflow status flag and maskable interrupt
●
External clock input (must be at least four times slower than the CPU clock speed) with
the choice of active edge
●
1 or 2 output compare functions each with:
–
2 dedicated 16-bit registers
–
2 dedicated programmable signals
–
2 dedicated status flags
–
1 dedicated maskable interrupt
●
1 or 2 input capture functions each with:
–
2 dedicated 16-bit registers
–
2 dedicated active edge selection signals
–
2 dedicated status flags
–
1 dedicated maskable interrupt
●
Pulse width modulation mode (PWM)
●
One pulse mode
●
Reduced power mode
●
5 alternate functions on I/O ports (ICAP1, ICAP2, OCMP1, OCMP2, EXTCLK)(c)
The timer block diagram is shown in
Figure 34.
c.
When reading an input signal on a non-bonded pin, the value will always be ‘1’.