English
Language : 

AT89LP51IC2_14 Datasheet, PDF (47/254 Pages) ATMEL Corporation – 8-bit Microcontroller Compatible with 8051 Products
AT89LP51RB2/RC2/IC2 Preliminary
6.8 System Clock Prescaler
The AT89LP51RB2/RC2/IC2 includes an 8-bit prescaler that allows the system clock to be
divided down from the selected clock source by even numbers in the range 4–1020 in X1 mode
and 2–510 in X2 mode. The prescaler can reduce power consumption by decreasing the opera-
tional frequency during non-critical periods. The prescaler is implemented as an 8-bit counter
with reload. Upon overflow from FFH to 00H the counter is reloaded with the value of the CKRL
register. When CKRL = FFH the prescaler is disabled. The resulting system frequency is given
by the following equations where fOSC is the frequency of the selected clock source and X2 is the
value of CKCON0.0:
fSYS
=
----------f--O---S----C----×------2----X---2----------
4 × (255 – CKRL)
(CKRL < 255)
fSYS
=
-f-O----S---C-----×------2---X----2
2
(CKRL = 255)
The clock divider will prescale the clock for the CPU and all peripherals. The value of CKRL may
be changed at any time without interrupting normal execution. Changes to CKRL will take affect
on the next prescaler overflow. When CKRL is updated, the new frequency will take affect within
a maximum period of 1024 x tOSC. The prescaler is disabled by reset.
Table 6-7. CKRL – Clock Reload Register
CKRL = 97H
Not Bit Addressable
CKRL7
CKRL6
CKRL5
Bit
7
6
5
CKRL4
4
CKRL3
3
Reset Value = 1111 1111B
CKRL2
2
CKRL1
1
CKRL0
0
Symbol
CKRL7-0
Function
Clock Reload. CKRL holds the reload value for the 8-bit system clock prescaler. When CKRL = FFH the prescaler is
disabled and no division is used. For all other values, the prescaler counts up to FFH and is reloaded with the value of
CKRL on the overflow to 00H. Each overflow of the prescaler will toggle the system clock. Changes to CKRL will take
affect on the next overflow.
Table 6-8. CLKREG – Clock Register
CLKREG = AEH
Not Bit Addressable
TPS3
TPS2
TPS1
TPS0
—
Bit
7
6
5
4
3
Reset Value = 0101 XXXXB
—
—
—
2
1
0
Symbol
TPS3-0
Function
Timer Prescaler. The Timer Prescaler selects the time base for Timer 0, Timer 1, Timer 2, PCA and the Watchdog
Timer. The prescaler is implemented as a 4-bit binary down counter. When the counter reaches zero it is reloaded with
the value stored in the TPS bits to give a division ratio between 1 and 16. By default TPS is set to 5 for counting every six
cycles (AT89C51RB2/RC2/IC2 compatibility). The prescaler is always enabled in Compatibility mode. In Fast mode the
prescaler is off by default and can be individually enabled for the peripherals through the CKCON0 and CKCON1 SFRs.
47
3722A–MICRO–10/11