Atmel ATA6616/ATA6617
4.5.3.3
4.5.3.4
4.5.3.5
4.5.3.6
4.5.3.7
Enable/Disable Clock Source
The ‘Enable Clock Source’ command selects and enables a clock source configured by the
settings in the CLKSELR register. CSEL3..0 will select the clock source and CSUT1:0 will
select the start-up time (just as CKSEL and SUT fuse bits do). To be sure that a clock source
is operating, the ‘Request for Clock Availability’ command must be executed after the ‘Enable
Clock Source’ command. This will indicate via the CLKRDY bit in the CLKCSR register that a
valid clock source is available and operational.
The ‘Disable Clock Source’ command disables the clock source indicated by the settings of
CLKSELR register (only CSEL3..0). If the clock source indicated is currently the one that is
used to drive the system clock, the command is not executed.
Because the selected configuration is latched at clock source level, it is possible to enable
many clock sources at a given time (ex: the internal RC oscillator for system clock + an oscilla-
tor with external crystal). The user (code) is responsible of this management.
COUT Command
The ‘CKOUT’ command allows to drive the CLKO pin. Refer to Section 4.5.2.7 “Clock Output
Buffer” on page 55 for using.
Clock Availability
‘Request for Clock Availability’ command enables a hardware oscillation cycle counter driven
by the selected source clock, CSEL3..0. The count limit value is determined by the settings of
CSUT1..0. The clock is declared ready (CLKRDY = 1) when the count limit value is reached.
The CLKRDY flag is reset when the count starts. Once set, this flag remains unchanged until a
new count is commanded. To perform this checking, the CKSEL and CSUT fields should not
be changed while the operation is running.
Note that once the new clock source is selected (‘Enable Clock Source’ command), the count
procedure is automatically started. The user (code) should wait for the setting of the CLKRDY
flag in CLKSCR register before using a newly selected clock.
At any time, the user (code) can ask for the availability of a clock source. The user (code) can
request it by writing the ‘Request for Clock Availability’ command in the CLKSCR register. A
full polling of the status of clock sources can thus be done.
System Clock Source Recovering
The ‘Recover System Clock Source’ command returns the current clock source used to drive
the system clock as per Table 4-5 on page 49. The CKSEL field of CLKSELR register is then
updated with this returned value. There is no information on the SUT used or status on
CKOUT.
Clock Switching
To drive the system clock, the user can switch from the current clock source to any other of the
following ones (one of them being the current clock source):
1. Calibrated internal RC oscillator 8.0MHz,
2. Internal watchdog oscillator 128kHz,
3. External clock,
4. External low-frequency oscillator,
5. External Crystal/Ceramic Resonator.
57
9132D–AUTO–12/10