English
Language : 

ST10F273Z4 Datasheet, PDF (59/188 Pages) STMicroelectronics – 16-bit MCU with 512 Kbyte Flash memory and 36 Kbyte RAM
ST10F273Z4
11 General purpose timer unit
General purpose timer unit
The GPT unit is a flexible multifunctional timer/counter structure which is used for time
related tasks such as event timing and counting, pulse width and duty cycle measurements,
pulse generation, or pulse multiplication. The GPT unit contains five 16-bit timers organized
into two separate modules GPT1 and GPT2. Each timer in each module may operate
independently in several different modes, or may be concatenated with another timer of the
same module.
11.1
GPT1
Each of the three timers T2, T3, T4 of the GPT1 module can be configured individually for
one of four basic modes of operation: timer, gated timer, counter mode and incremental
interface mode.
In timer mode, the input clock for a timer is derived from the CPU clock, divided by a
programmable prescaler.
In counter mode, the timer is clocked in reference to external events.
Pulse width or duty cycle measurement is supported in gated timer mode where the
operation of a timer is controlled by the ‘gate’ level on an external input pin. For these
purposes, each timer has one associated port pin (TxIN) which serves as gate or clock
input.
Table 36 and Table 37 list the timer input frequencies, resolution and periods for each pre-
scaler option at 40MHz and 64MHz CPU clock respectively.
In Incremental Interface mode, the GPT1 timers (T2, T3, T4) can be directly connected to
the incremental position sensor signals A and B by their respective inputs TxIN and TxEUD.
Direction and count signals are internally derived from these two input signals so that the
contents of the respective timer Tx corresponds to the sensor position. The third position
sensor signal TOP0 can be connected to an interrupt input.
Timer T3 has output toggle latches (TxOTL) which changes state on each timer over flow /
underflow. The state of this latch may be output on port pins (TxOUT) for time out monitoring
of external hardware components, or may be used internally to clock timers T2 and T4 for
high resolution of long duration measurements.
In addition to their basic operating modes, timers T2 and T4 may be configured as reload or
capture registers for timer T3.
Table 36. GPT1 timer input frequencies, resolutions and periods at 40 MHz
fCPU = 40 MHz
000b
001b
Timer Input Selection T2I / T3I / T4I
010b
011b
100b
101b
110b
111b
Pre-scaler factor
Input frequency
8
5 MHz
16
32
64
128
256
512
1024
2.5 MHz 1.25 MHz 625 kHz 312.5 kHz 156.25 kHz 78.125 kHz 39.1 kHz
Resolution
Period maximum
200 ns 400 ns 0.8 µs
1.6µs
3.2µs
6.4 µs
13.1 ms 26.2 ms 52.4 ms 104.8 ms 209.7 ms 419.4 ms
12.8 µs
838.9 ms
25.6 µs
1.678 s
59/188