
Chapter 14. Timers/Counters and Serial Interface Page 14-7
Figure 14-3. Timer 0 - Mode 3
14.2.3 Timer Rate Control
By default, the FX2 timers increment every 12 CLKOUT cycles, just as in the standard 8051. Using
this default rate allows existing application code with real-time dependencies, such as baud rate, to
operate properly.
Applications that require fast timing can set the timers to increment every 4 CLKOUT cycles
instead, by setting bits in the Clock Control Register (CKCON) at SFR location 0x8E. (See
Table 14-4).
Each timer’s rate can be set independently. These settings have no effect in counter mode.
Table 14-4. CKCON (SFR 0x8E) Timer Rate Control Bits
Bit Function
CKCON.5 T2M - Timer 2 clock select. When T2M = 0, Timer 2 uses CLKOUT/12 (for
compatibility with standard 8051); when T2M = 1, Timer 2 uses CLKOUT/4.
This bit has no effect when Timer 2 is configured for baud rate generation.
CKCON.4 T1M - Timer 1 clock select. When T1M = 0, Timer 1 uses CLKOUT/12 (for
compatibility with standard 8051); when T1M = 1, Timer 1 uses CLKOUT/4.
CKCON.3 T0M - Timer 0 clock select. When T0M = 0, Timer 0 uses CLKOUT/12 (for
compatibility with standard 8051); when T0M = 1, Timer 0 uses CLKOUT/4.
TL0
0
7
Divide by 12
Divide by 4
T0 pin
TR0
GATE
INT0 pin 7
0
TF0
TH0
T0M
INT
TR1
TF1
INT
0
1
0
1
CLKOUT
CLK
C/ T
Kommentare zu diesen Handbüchern