Datasheet

29
ATmega48/88/168 Automotive [DATASHEET]
7530K–AVR–07/14
6.6.1 Oscillator Calibration Register – OSCCAL
Bits 7..0 – CAL7..0: Oscillator Calibration Value
The oscillator calibration register is used to trim the calibrated internal RC oscillator to remove process variations from the
oscillator frequency. The factory-calibrated value is automatically written to this register during chip reset, giving an oscillator
frequency of 8.0MHz at 25°C. The application software can write this register to change the oscillator frequency. The
oscillator can be calibrated to any frequency in the range 7.3 - 8.1MHz within ±1% accuracy. Calibration outside that range is
not guaranteed.
Note that this oscillator is used to time EEPROM and flash write accesses, and these write times will be affected accordingly.
If the EEPROM or flash are written, do not calibrate to more than 8.8MHz. Otherwise, the EEPROM or flash write may fail.
The CAL7 bit determines the range of operation for the oscillator. Setting this bit to 0 gives the lowest frequency range,
setting this bit to 1 gives the highest frequency range. The two frequency ranges are overlapping, in other words a setting of
OSCCAL = 0x7F gives a higher frequency than OSCCAL = 0x80.
The CAL6..0 bits are used to tune the frequency within the selected range. A setting of 0x00 gives the lowest frequency in
that range, and a setting of 0x7F gives the highest frequency in the range. Incrementing CAL6..0 by 1 will give a frequency
increment of less than 2% in the frequency range 7.3 - 8.1MHz.
6.7 128 kHz Internal Oscillator
The 128kHz internal oscillator is a low power oscillator providing a clock of 128kHz. The frequency is nominal at 3V and
25°C. This clock may be select as the system clock by programming the CKSEL fuses to “11” as shown in Table 6-10.
When this clock source is selected, start-up times are determined by the SUT fuses as shown in Table 6-11.
Bit 76543210
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 Value Device Specific Calibration Value
Table 6-10. 128kHz Internal Oscillator Operating Modes
Nominal Frequency CKSEL3..0
128kHz 0011
Note: 1. The frequency is preliminary value. Actual value is TBD.
Table 6-11. Start-up Times for the 128kHz Internal Oscillator
Power Conditions
Start-up Time from Power-down and
Power-save
Additional Delay from Reset SUT1..0
BOD enabled 6CK 14CK
(1)
00
Fast rising power 6CK 14CK + 4ms 01
Slowly rising power 6CK 14CK + 64ms 10
Reserved 11
Note: 1. If the RSTDISBL fuse is programmed, this start-up time will be increased to
14CK + 4.1ms to ensure programming mode can be entered.