Calibrated Internal Rc Oscillator; Oscillator Calibration Register – Osccal - Atmel ATmega128 Manual

8-bit avr microcontroller with 128k bytes in-system programmable flash
Hide thumbs Also See for ATmega128:
Table of Contents

Advertisement

Calibrated Internal
RC Oscillator
Oscillator Calibration
Register – OSCCAL
ATmega128
42
The Calibrated Internal RC Oscillator provides a fixed 1.0, 2.0, 4.0, or 8.0 MHz clock. All fre-
quencies are nominal values at 5V and 25°C. This clock may be selected as the system clock by
programming the CKSEL fuses as shown in
components. The CKOPT fuse should always be unprogrammed when using this clock option.
During Reset, hardware loads the calibration byte for the 1MHz oscillator into the OSCCAL Reg-
ister and thereby automatically calibrates the RC Oscillator. At 5V, 25°C and 1.0 MHz Oscillator
frequency selected, this calibration gives a frequency within ± 3% of the nominal frequency.
Using calibration methods as described in application notes available at www.atmel.com/avr it is
possible to achieve ± 1% accuracy at any given V
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-programmed calibration value, see the sec-
tion
"Calibration Byte" on page
Table 13. Internal Calibrated RC Oscillator Operating Modes
CKSEL3..0
(1)
0001
0010
0011
0100
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
14. XTAL1 and XTAL2 should be left unconnected (NC).
Table 14. Start-up Times for the Internal Calibrated RC Oscillator Clock Selection
Start-up Time from Power-
SUT1..0
down and Power-save
00
6 CK
01
6 CK
(1)
10
6 CK
11
Notes:
1. The device is shipped with this option selected.
Bit
7
6
CAL7
CAL6
Read/Write
R/W
R/W
Initial Value
Note:
OSCCAL Register is not available in ATmega103 compatibility mode.
• 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 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 calibra-
tion 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
Table
13. If selected, it will operate with no external
and Temperature. When this Oscillator is
CC
289.
Nominal Frequency (MHz)
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
1.0
2.0
4.0
8.0
Recommended Usage
BOD enabled
Fast rising power
Slowly rising power
2
1
0
CAL2
CAL1
CAL0
OSCCAL
R/W
R/W
R/W
2467S–AVR–07/09

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ATmega128 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Atmega128l

Table of Contents

Save PDF