English
Language : 

ST10F273E Datasheet, PDF (61/179 Pages) STMicroelectronics – 16-bit MCU with 512 Kbyte Flash memory and 36 Kbyte RAM
ST10F273E
General purpose timer unit
11.2
GPT2
The GPT2 module provides precise event control and time measurement. It includes two
timers (T5, T6) and a capture/reload register (CAPREL). Both timers can be clocked with an
input clock which is derived from the CPU clock via a programmable prescaler or with
external signals. The count direction (up/down) for each timer is programmable by software
or may additionally be altered dynamically by an external signal on a port pin (TxEUD).
Concatenation of the timers is supported via the output toggle latch (T6OTL) of timer T6
which changes its state on each timer overflow/underflow.
The state of this latch may be used to clock timer T5, or it may be output on a port pin
(T6OUT). The overflow / underflow of timer T6 can additionally be used to clock the
CAPCOM timers T0 or T1, and to cause a reload from the CAPREL register. The CAPREL
register may capture the contents of timer T5 based on an external signal transition on the
corresponding port pin (CAPIN), and timer T5 may optionally be cleared after the capture
procedure. This allows absolute time differences to be measured or pulse multiplication to
be performed without software overhead.
The capture trigger (timer T5 to CAPREL) may also be generated upon transitions of GPT1
timer T3 inputs T3IN and/or T3EUD. This is advantageous when T3 operates in Incremental
Interface mode.
Table 37 and Table 38 list the timer input frequencies, resolution and periods for each pre-
scaler option at 40MHz and 64MHz CPU clock respectively.
Table 37. GPT2 timer input frequencies, resolutions and periods at 40 MHz
fCPU = 40MHz
000b
001b
Timer Input Selection T5I / T6I
010b 011b 100b 101b
110b
111b
Pre-scaler
factor
4
8
16
32
64
128
256
512
Input frequency 10MHz 5MHz 2.5MHz
1.25
MHz
625 kHz
312.5
kHz
156.25
kHz
78.125
kHz
Resolution
100ns 200ns 400ns 0.8µs 1.6µs 3.2µs 6.4µs 12.8µs
Period
maximum
6.55ms 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms
Table 38. GPT2 timer input frequencies, resolutions and periods at 64 MHz
fCPU = 64MHz
000b
001b
Timer Input Selection T5I / T6I
010b 011b 100b 101b
110b
111b
Pre-scaler
factor
4
Input frequency 16MHz
Resolution
62.5ns
Period
maximum
4.1ms
8
8MHz
125ns
8.2ms
16
4MHz
250ns
16.4ms
32
2MHz
0.5µs
32.8ms
64
128
256
512
1 kHz 500 kHz 250 kHz 128 kHz
1.0µs 2.0µs 4.0µs 8.0µs
65.5ms 131.1ms 262.1ms 524.3ms
61/179