English
Language : 

ATMEGA8_14 Datasheet, PDF (31/331 Pages) ATMEL Corporation – High-performance, Low-power Atmel
ATmega8(L)
Oscillator Calibration
Register – OSCCAL
Bit
Read/Write
Initial Value
7
CAL7
R/W
6
CAL6
R/W
5
4
3
2
CAL5
CAL4
CAL3
CAL2
R/W
R/W
R/W
R/W
Device Specific Calibration Value
1
CAL1
R/W
0
CAL0
R/W
OSCCAL
• Bits 7..0 – CAL7..0: Oscillator Calibration Value
Writing the calibration byte to this address will trim the Internal Oscillator to remove process vari-
ations from the Oscillator frequency. During Reset, the 1MHz calibration value which is located
in the signature row High byte (address 0x00) is automatically loaded into the OSCCAL Regis-
ter. If the internal RC is used at other frequencies, the calibration values 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 Oscil-
lator. Writing 0xFF 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 Oscillator is intended for calibration to 1.0MHz, 2.0MHz, 4.0MHz, or 8.0MHz. Tun-
ing to other values is not guaranteed, as indicated in Table 11.
Table 11. Internal RC Oscillator Frequency Range
OSCCAL Value
Min Frequency in Percentage of
Nominal Frequency (%)
0x00
50
0x7F
75
0xFF
100
Max Frequency in Percentage of
Nominal Frequency (%)
100
150
200
31
2486AA–AVR–02/2013