atmega323l ATMEL Corporation, atmega323l Datasheet - Page 41

no-image

atmega323l

Manufacturer Part Number
atmega323l
Description
Atmega323 8-bit Avr Microcontroller With 32k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
Calibrated Internal
RC Oscillator
Oscillator Calibration Register
– OSCCAL
Special Function IO Register –
SFIOR
1457G–AVR–09/03
The calibrated internal Oscillator provides a fixed 1.0 MHz (nominal) clock at 5V and
25 C. This clock may be used as the system clock. See the section “Clock Options” on
page 6 for information on how to select this clock as the system clock. This Oscillator
can be calibrated by writing the calibration byte to the OSCCAL Register. 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 details on how to use the pre-pro-
grammed calibration value, see the section “Calibration Byte” on page 188.
• 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. 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 avail-
able 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 fre-
quency. Otherwise, the EEPROM or Flash write may fail. Note that the Oscillator is
intended for calibration to 1.0 MHz, thus tuning to other values is not guaranteed.
Table 11. Internal RC Oscillator Frequency Range
• Bit 7..4 – Res: Reserved Bits
These bits are reserved bits in the ATmega323 and always read as zero.
• Bit 3 – ACME: Analog Comparator Multiplexer Enable
When this bit is set (one) and the ADC is switched off (ADEN in ADCSR is zero), the
ADC multiplexer selects the negative input to the Analog Comparator. When this bit is
cleared (zero), AIN1 is applied to the negative input of the Analog Comparator. For a
detailed description of this bit, see “Analog Comparator Multiplexed Input” on page 126.
• Bit 2 – PUD: Pull-up Disable
When this bit is set (one), all pull-ups on all ports are disabled. If the bit is cleared (zero),
the pull-ups can be individually enabled as described in the chapter “I/O Ports” on page
137.
Bit
$31 ($51)
Read/Write
Initial Value
Bit
$30 ($50)
Read/Write
Initial Value
OSCCAL Value
$7F
$FF
$00
CAL7
R/W
7
0
R
7
0
CAL6
R/W
6
0
R
6
0
CAL5
R/W
5
0
R
5
0
Min Frequency (MHz)
CAL4
R/W
4
0
R
4
0
0.5
0.7
1.0
CAL3
ACME
R/W
R/W
3
0
3
0
CAL2
R/W
PUD
R/W
2
0
2
0
ATmega323(L)
Max Frequency (MHz)
CAL1
R/W
PSR2
R/W
1
0
1
0
1.0
1.5
2.0
CAL0
R/W
PSR10
0
0
R/W
0
0
OSCCAL
SFIOR
41

Related parts for atmega323l