Oscillator Calibration Register
– OSCCAL
ATmega32(L)
30
When this Oscillator is selected, start-up times are determined by the SUT fuses as
shown in Table 10. XTAL1 and XTAL2 should be left unconnected (NC).
Table 10. Start-up Times for the Internal Calibrated RC Oscillator Clock Selection
Start-up Time from
Power-down and
SUT1..0
Power-save
00
6 CK
01
6 CK
(1)
10
6 CK
11
Note:
1. The device is shipped with this option selected.
Bit
7
6
CAL7
CAL6
Read/Write
R/W
R/W
Initial Value
• 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
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 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
Oscillator is intended for calibration to 1.0, 2.0, 4.0, or 8.0 MHz. Tuning to other values is
not guaranteed, as indicated in Table 11.
Table 11. Internal RC Oscillator Frequency Range.
Min Frequency in Percentage of
OSCCAL Value
Nominal Frequency (%)
$00
$7F
$FF
Additional Delay
from Reset
(V
= 5.0V)
CC
–
4.1 ms
65 ms
Reserved
5
4
3
CAL5
CAL4
CAL3
R/W
R/W
R/W
Device Specific Calibration Value
Max Frequency in Percentage of
50
75
100
Recommended Usage
BOD enabled
Fast rising power
Slowly rising power
2
1
0
CAL2
CAL1
CAL0
OSCCAL
R/W
R/W
R/W
Nominal Frequency (%)
100
150
200
Need help?
Do you have a question about the AVR ATmega32 and is the answer not in the manual?
Questions and answers