Datasheet
34
ATmega16U4/32U4 [DATASHEET]
Atmel-7766J-USB-ATmega16U4/32U4-Datasheet_04/2016
When applying an external clock, it is required to avoid sudden changes in the applied clock frequency to
ensure stable operation of the MCU. A variation in frequency of more than 2% from one clock cycle to the next
can lead to unpredictable behavior. If changes of more than 2% is required, ensure that the MCU is kept in
Reset during the changes.
Note that the System Clock Prescaler can be used to implement run-time changes of the internal clock
frequency while still ensuring stable operation. Refer to “System Clock Prescaler” on page 35 for details.
6.7 Clock Switch
The device includes a Clock Switch controller, that allows user to switch from one clock source to another one
by software, in order to control application power and execution time with more accuracy.
6.7.1 Example of use
The modification may be needed when the device enters in USB Suspend mode. It then switches from External
Clock to Calibrated RC Oscillator in order to reduce consumption and wake-up delay. In such a configuration,
the External Clock is disabled. The firmware can then use the watchdog timer to be woken-up from power-down
in order to check if there is an event on the application. If an event occurs on the application or if the USB con-
troller signals a non-idle state on the USB line (Resume for example), the firmware switches the Clock
Multiplexer from the Calibrated RC Oscillator to the External Clock. in order to restart USB operation.
This feature can only be used to switch between Calibrated 8MHz RC Oscillator, External Clock and Low Power
Crystal Oscillator. The Low Frequency Crystal Oscillator must not be used with this feature.
Figure 6-4. Example of Clock Switching with Wake-up from USB Host
Table 6-9. Start-up Times for the External Clock Selection
Power Conditions
Start-up Time from Power-
down and Power-save
Additional Delay from
Reset (V
CC
= 5.0V) SUT1..0
BOD enabled 6CK 14CK 00
Fast rising power 6CK 14CK + 4.1ms 01
Slowly rising power 6CK 14CK + 65ms 10
Reserved 11
USB
CPU Clock
External
Oscillator
RC oscillator
Ext RC Ext
non-Idle Idle
(Suspend)
non-Idle
3m
s
resume
1
1
Resume from Host
watchdog wake-up
from power-down