34
8008H–AVR–04/11
ATtiny48/88
6.6
Register Description
6.6.1
OSCCAL – Oscillator Calibration Register
The Oscillator Calibration Register is used to trim the internal oscillator to remove process varia-
tions from the oscillator frequency. A pre-programmed calibration value is automatically written
to this register during chip reset, giving the factory calibrated frequency as specified in
Table 22-The application software can write to the OSCCAL register to change the oscillator frequency.
tion outside the given range is not guaranteed.
Note that this oscillator is used to time EEPROM and Flash write accesses, and the write times
will be affected accordingly. If the EEPROM or Flash are written, do not calibrate to more than
8.8 MHz. Otherwise, the EEPROM or Flash write may fail.
All register bits are in use for frequency . A setting of 0x00 gives the lowest frequency and a set-
ting of 0xFF gives the highest frequency.
6.6.2
CLKPR – Clock Prescale Register
Bit 7 – CLKPCE: Clock Prescaler Change Enable
The CLKPCE bit must be written to logic one to enable change of the CLKPS bits. The CLKPCE
bit is only updated when the other bits in CLKPR are simultaneously written to zero. CLKPCE is
cleared by hardware four cycles after it is written or when CLKPS bits are written. Rewriting the
CLKPCE bit within this time-out period does neither extend the time-out period, nor clear the
CLKPCE bit.
Bits 6:4 – Res: Reserved Bits
These bits are reserved and will always read zero.
Bits 3:0 – CLKPS[3:0]: Clock Prescaler Select Bits 3 - 0
These bits define the division factor between the selected clock source and the internal system
clock. These bits can be written run-time to vary the clock frequency to suit the application
requirements. As the divider divides the master clock input to the MCU, the speed of all synchro-
nous peripherals is reduced when a division factor is used. The division factors are given in
The CKDIV8 Fuse determines the initial value of the CLKPS bits. If CKDIV8 is unprogrammed,
the CLKPS bits will be reset to 0b0000. If CKDIV8 is programmed, CLKPS bits are reset to
0b0011, giving a division factor of 8 at start up. This feature should be used if the selected clock
source has a higher frequency than the maximum frequency of the device at the present operat-
ing conditions. Note that any value can be written to the CLKPS bits regardless of the CKDIV8
Fuse setting. The Application software must ensure that a sufficient division factor is chosen if
Bit
7
654
32
10
CAL7
CAL6
CAL5
CAL4
CAL3
CAL2
CAL1
CAL0
OSCCAL
Read/Write
R/W
Initial Value
Device Specific Calibration Value
Bit
7
6
5
4
3210
CLKPCE
–
CLKPS3
CLKPS2
CLKPS1
CLKPS0
CLKPR
Read/Write
R/W
R
R/W
Initial Value
0
See Bit Description