104/317
5 - Peripherals
5.5.1 Timer clock
Two clock sources are available for the timer: either the core clock, or an external clock sup-
plied on a pin that takes up one port pin.
When the internal clock is used, the timer is actually fed with the core clock after passing
through a frequency divider that can divide the core clock frequency by 2, 4 or 8. The core fre-
quency is itself derived from the crystal oscillator by dividing it by 2 (normal mode) or a higher
value that depends on the variant of ST7 considered (slow mode), as selected in the miscel-
laneous register (see the beginning of this chapter).
The external clock, when selected, changes one parallel input-output pin into a clock input.
The frequency applied to the pin is directly fed to the timer with no predivision. The external
clock is only available on Timer A on the ST72251 and ST72311.
05-timck
To give an idea of the time resolution of the timer, the following table give the resolutions avail-
able with a 16 MHz crystal for all divider selections:
Timer clock predivisor
Core predivisor
1/2
1/4
1/8
1/2
0.25
0.5
1
1/32
4
8
16
Prescaler Timer clk CPU clk
0
0
0
1
1
0
1
1
1 / 4
1 / 2
1 / 8
External
CC1 CC0
EXEDG
1
0
rising or falling
edge selection
External timer
clock pin *
External
timer c lock
CPU clock
or
Internal
timer c lock
* External clock pins are available
only on timerA :
Pc5 for the ST72251
Pf7 for the ST72311
Maximum frequency of
the external clock = 1/4 CPU clock
Timer Clock selection
Timer A contr ol
register 2 (T ACR2)
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...