Datasheet

40
ATmega323(L)
1457E11/01
Calibrated Internal
RC Oscillator
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 183.
Oscillator Calibration Register
OSCCAL
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 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 fre-
quency. Otherwise, the EEPROM or Flash write may fail. Note that the Oscillator is
intended for calibration to 1.0MHz, thus tuning to other values is not guaranteed.
Special Function IO Register
SFIOR
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 123.
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
134
Bit 76543210
$31 ($51) CAL7 CAL6 CAL5 CAL4 CAL3 CAL2 CAL1 CAL0 OSCCAL
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value00000000
Table 11. Internal RC Oscillator Frequency Range
OSCCAL Value Min Frequency (MHz) Max Frequency (MHz)
$00 0.5 1.0
$7F 0.7 1.5
$FF 1.0 2.0
Bit 76543210
$30 ($50) ----ACMEPUDPSR2PSR10SFIOR
Read/WriteRRRRR/WR/WR/WR/W
Initial Value00000000