Atmel Evaluation Kit AT91SAM9G25-EK AT91SAM9G25-EK Data Sheet

Product codes
AT91SAM9G25-EK
Page of 1165
171
SAM9G25 [DATASHEET]
11032D–ATARM–10-Mar-2014
20.3.1 Switch from Internal 32 kHz RC Oscillator to 32768 Hz Crystal Oscillator
To switch from the internal 32 kHz RC oscillator to the 32768 Hz crystal oscillator, the programmer must execute the 
following sequence:
Switch the master clock to a source different from slow clock (PLL or Main Oscillator) through the Power 
Management Controller.
Enable the 32768 Hz oscillator by setting the bit OSC32EN to 1.
Wait 32768 Hz Startup Time for clock stabilization (software loop).
Switch from internal 32 kHz RC oscillator to 32768 Hz oscillator by setting the bit OSCSEL to 1.
Wait 5 slow clock cycles for internal resynchronization.
Disable the 32 kHz RC oscillator by setting the bit RCEN to 0.
20.3.2 Bypass the 32768 Hz Oscillator
The following steps must be added to bypass the 32768 Hz oscillator:
An external clock must be connected on XIN32.
Enable the bypass path OSC32BYP bit set to 1.
Disable the 32768 Hz oscillator by setting the OSC32EN bit to 0.
20.3.3 Switch from 32768 Hz Crystal Oscillator to Internal 32 kHz RC Oscillator
The same procedure must be followed to switch from the 32768 Hz crystal oscillator to the internal 32 kHz RC oscillator:
Switch the master clock to a source different from slow clock (PLL or Main Oscillator). 
Enable the internal 32 kHz RC oscillator for low power by setting the bit RCEN to 1
Wait internal 32 kHz RC Startup Time for clock stabilization (software loop).
Switch from 32768 Hz oscillator to internal RC by setting the bit OSCSEL to 0.
Wait 5 slow clock cycles for internal resynchronization.
Disable the 32768 Hz oscillator by setting the bit OSC32EN to 0.