Power save mode, Calibrated internal rc oscillator, Oscillator calibration register - osccal – Rainbow Electronics ATmega163L User Manual
Page 32: Special function io register - sfior, Atmega163(l)

ATmega163(L)
32
When waking up from Power-down Mode, there is a delay from the wake-up condition occurs until the wake-up becomes
effective. This allows the clock to restart and become stable after having been stopped. The wake-up period is defined by
the same CKSEL fuses that define the reset time-out period, as seen in Table 5 on page 22.
Power Save Mode
When the SM1/SM0 bits are 11, the SLEEP instruction forces the MCU into the Power Save Mode. This mode is identical
to Power Down, with one exception:
If Timer/Counter2 is clocked asynchronously, i.e. the AS2 bit in ASSR is set, Timer/Counter2 will run during sleep. The
device can wake up from either Timer Overflow or Output Compare event from Timer/Counter2 if the corresponding
Timer/Counter2 interrupt enable bits are set in TIMSK, and the global interrupt enable bit in SREG is set.
If the asynchronous timer is NOT clocked asynchronously, Power Down Mode is recommended instead of Power Save
Mode because the contents of the registers in the asynchronous timer should be considered undefined after wake-up in
Power Save Mode if AS2 is 0.
Calibrated Internal RC Oscillator
The calibrated internal oscillator provides a fixed 1 MHz (nominal) clock at 5V and 25
°C. This clock may be used as the
system clock. See the section “Clock Options” on page 5 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.
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 process 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 frequency. Otherwise, the EEPROM or Flash write operation 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 ATmega163 and always read as zero.
Bit
7
6
5
4
3
2
1
0
$31 ($51)
CAL7
CAL6
CAL5
CAL4
CAL3
CAL2
CAL1
CAL0
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial value
0
0
0
0
0
0
0
0
Table 10. Internal RC Oscillator Frequency Range.
OSCCAL value
Min. Frequency
Max. Frequency
$00
0.5 MHz
1.0 MHz
$7F
0.7 MHz
1.5 MHz
$FF
1.0 MHz
2.0 MHz
Bit
7
6
5
4
3
2
1
0
$30 ($50)
-
-
-
-
ACME
PUD
PSR2
PSR10
SFIOR
Read/Write
R
R
R
R
R/W
R/W
R/W
R/W
Initial value
0
0
0
0
0
0
0
0