beautypg.com

Oscillator calibration register – osccal, Atmega169v/l – Rainbow Electronics Atmega169L User Manual

Page 28

background image

28

ATmega169V/L

2514A–AVR–08/02

Oscillator Calibration Register
– OSCCAL

• Bits 6..0 – CAL6..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. This is done automatically during Chip
Reset. 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
0x7F 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 cali-
brate 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 8.0 MHz. Tuning to
other values is not guaranteed, as indicated in Table 10.

Bit

7

6

5

4

3

2

1

0

CAL6

CAL5

CAL4

CAL3

CAL2

CAL1

CAL0

OSCCAL

Read/Write

R

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Initial Value

Device Specific Calibration Value

Table 10. Internal RC Oscillator Frequency Range.

OSCCAL Value

Min Frequency in Percentage of

Nominal Frequency

Max Frequency in Percentage of

Nominal Frequency

0x00

50%

100%

0x3F

75%

150%

0x7F

100%

200%