Calibrated internal rc oscillator, Oscillator calibration register – osccal, Attiny26(l) – Rainbow Electronics ATtiny26L User Manual
Page 31
31
ATtiny26(L)
1477B–AVR–04/02
Calibrated Internal RC
Oscillator
The calibrated internal RC Oscillator provides a fixed 1.0, 2.0, 4.0, or 8.0 MHz clock. All
frequencies are nominal values at 5V and 25
°C. This clock may be selected as the sys-
tem clock by programming the CKSEL Fuses as shown in Table 12. If selected, it will
operate with no external components. The CKOPT Fuse should always be unpro-
grammed when using this clock option. During Reset, hardware loads the calibration
byte into the OSCCAL Register and thereby automatically calibrates the RC Oscillator.
When this oscillator is used as the chip clock, the Watchdog Oscillator will still be used
for the Watchdog Timer and for the reset time-out. For more information on the pre-pro-
grammed calibration value, see the section “Calibration Byte” on page 108.
Note:
1. The device is shipped with this option selected.
When this oscillator is selected, start-up times are determined by the SUT Fuses as
shown in Table 13. PB4 (XTAL1) and PB5 (XTAL2) can be used as general I/O ports.
Note:
1. The device is shipped with this option selected.
Oscillator Calibration Register
– OSCCAL
• Bits 7..0 – CAL7..0: Oscillator Calibration Value
Writing the calibration byte to this address will trim the internal oscillator to remove pro-
cess variations from the oscillator frequency. During Reset, the 1 MHz calibration value
which is located in the signature row high byte (address 0x00) is automatically loaded
into the OSCCAL Register. If the internal RC is used at other frequencies, the calibration
value must be loaded manually. This can be done by first reading the signature row by a
programmer, and then store the calibration values in the Flash or EEPROM. Then the
value can be read by software and loaded into the OSCCAl Register. When OSCCAL is
zero, the lowest available frequency is chosen. Writing non-zero values to this register
will increase the frequency of the internal oscillator. Writing $FF to the register gives the
highest available frequency. The calibrated Oscillator is used to time EEPROM and
Flash access. If EEPROM or Flash is written, do not calibrate to more than 10% above
the nominal frequency. Otherwise, the EEPROM or Flash write may fail. Note that the
Table 12. Internal Calibrated RC Oscillator Operating Modes
CKSEL3..0
Nominal Frequency (MHz)
0001
1.0
0010
2.0
0011
4.0
0100
8.0
Table 13. Start-up Times for the Internal Calibrated RC Oscillator Clock Selection
SUT1..0
Start-up Time from
Power-down
Additional Delay from
Reset (V
CC
= 5.0V)
Recommended Usage
00
6 CK
–
BOD enabled
01
6 CK
4.1 ms
Fast rising power
6 CK
65 ms
Slowly rising power
11
Reserved
Bit
7
6
5
4
3
2
1
0
CAL7
CAL6
CAL5
CAL4
CAL3
CAL2
CAL1
CAL0
OSCCAL
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial Value
Device Specific Calibration Value