Atmel ARM-Based Evaluation Kit AT91SAM9N12-EK AT91SAM9N12-EK Data Sheet

Product codes
AT91SAM9N12-EK
Page of 1104
164
SAM9N12/SAM9CN11/SAM9CN12 [DATASHEET]
11063K–ATARM–05-Nov-13
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 OSCSEL bit to 1.
Wait 5 slow clock cycles for internal resynchronization.
Disable the 32 kHz RC oscillator by setting the RCEN bit 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 by setting the OSC32BYP bit 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 RCEN bit 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 OSCSEL bit to 0.
Wait 5 slow clock cycles for internal resynchronization.
Disable the 32768 Hz oscillator by setting the OSC32EN bit to 0.