ATmega8U2/16U2/32U2
lator is selected by the fuse bits configuration. The firmware has to check if the clock is correctly
started before selected it.
8.11.2
CLKSEL1 – Clock Selection Register 1
Bit
(0xD1)
7
6
5
4
3
2
1
0
RCCKSE
RCCKSE
L2
RCCKSE
L1
RCCKSE
L0
EXCKSE
L3
EXCKSE
L2
EXCKSE
L1
EXCKSE
L0
CLKSEL1
L3
R/W
0
Read/Write
Initial Value
R/W
0
R/W
1
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
• Bit 7:4 – RCCKSEL[3:0]: CKSEL for RC oscillator
Clock configuration for the RC Oscillator. After a reset, this part of the register is loaded with the
0010b value that corresponds to the RC oscillator. Modifying this value by firmware before
switching to RC oscillator is prohibited because the RC clock will not start.
• Bit 3:0 – EXCKSEL[3:0]: CKSEL for External oscillator / Low Power Oscillator
Clock configuration for the External Oscillator / Low Power Oscillator. After a reset, if the Exter-
nal oscillator / Low Power Oscillator is selected by fuse bits, this part of the register is loaded
with the fuse configuration. Firmware can modify it to change the start-up time after the clock
switch.
8.11.3
CLKSTA – Clock Status Register
Bit
(0xD2)
7
6
-
5
-
4
-
3
-
2
-
1
RCON
R
0
EXTON
R
-
CLKSTA
Read/Write
Initial Value
R
0
R
0
R
0
R
0
R
R
See Bit Description
• Bit 7:2 - Res: Reserved bits
These bits are reserved and will always read as zero.
• Bit 1 – RCON: RC Oscillator On
This bit is set by hardware to one if the RC Oscillator is running.
This bit is set by hardware to zero if the RC Oscillator is stoped.
• Bit 0 – EXTON: External Oscillator / Low Power Oscillator On
This bit is set by hardware to one if the External Oscillator / Low Power Oscillator is running.
This bit is set by hardware to zero if the External Oscillator / Low Power Oscillator is stoped.
8.11.4
OSCCAL – Oscillator Calibration Register
Bit
(0x66)
7
6
5
4
3
2
1
0
CAL7
R/W
CAL6
R/W
CAL5
R/W
CAL4
R/W
CAL3
R/W
CAL2
R/W
CAL1
R/W
CAL0
R/W
OSCCAL
Read/Write
Initial Value
Device Specific Calibration Value
• Bits 7:0 – CAL[7: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. A pre-programmed calibration value is
automatically written to this register during chip reset, giving the Factory calibrated frequency as
specified in Table 26-1 on page 266. The application software can write this register to change
38
7799D–AVR–11/10