Datasheet

Table Of Contents
The Status register gathers different status signals coming from the oscillators controlled by the
OSCCTRL. The status signals can be used to generate system interrupts, and in some cases wake up
the system from Sleep mode, provided the corresponding interrupt is enabled.
28.6.2 External Multipurpose Crystal Oscillator (XOSCn) Operation
The XOSCn can operate in two different modes:
External clock, with an external clock signal connected to the XIN pin
Crystal oscillator, with an external 8-48 MHz crystal
The XOSCn can be used as a clock source for generic clock generators. This is configured by the
Generic Clock Controller.
At reset, the XOSCn is disabled, and the XINn/XOUTn pins can be used as General Purpose I/O (GPIO)
pins or by other peripherals in the system. When XOSCn is enabled, the operating mode determines the
GPIO usage. When in crystal oscillator mode, the XINn and XOUTn pins are controlled by the OSCCTRL,
and GPIO functions are overridden on both pins. When in external clock mode, only the XINn pins will be
overridden and controlled by the OSCCTRL, while the XOUTn pins can still be used as GPIO pins.
The XOSCn is enabled by writing a '1' to the Enable bit in the External Multipurpose Crystal Oscillator
Control register (XOSCCTRLn.ENABLE). To enable XOSCn as an external crystal oscillator, the XTAL
Enable bit (XOSCCTRLn.XTALEN) must written to '1'. If XOSCCTRLn.XTALEN is zero, the external clock
input on XIN will be enabled.
When in crystal oscillator mode (XOSCCTRLn.XTALEN=1), the External Multipurpose Crystal Oscillator
Current Control (XOSCCTRLn.IPTAT, XOSCCTRLn.IMULT) must be set to match the external crystal
oscillator frequency. If the External Multipurpose Crystal Oscillator Enable Amplitude Loop Control
(XOSCCTRLn.ENALC) is '1', the oscillator amplitude will be automatically adjusted, and in most cases
result in lower power consumption.
The bias current of the Crystal Oscillator can be adjusted to the desired value for a proper oscillation by
setting the bit fields XOSCCTRLn.IPTAT and XOSCCTRLn.IMULT. See the recommended setting in table
Table 28-7.
The low buffer gain is used to adjust the oscillator's amplitude in automatic loop control
(XOSCCTRLn.ENALC=1). The default value of LOWBUFGAIN=0 should be used to allow operating with
a low amplitude oscillator. The setting LOWBUFGAIN=1 can be used to to solve stability issues. If set, the
oscillator's amplitude is increased by a factor of approximately 2.
The XOSCn will behave differently in different sleep modes, based on the settings of
XOSCCTRLn.RUNSTDBY, XOSCCTRLn.ONDEMAND, and XOSCCTRLn.ENABLE
Table 28-1. XOSC Sleep Behavior
XOSCCTRLn.RUNS
TDBY
XOSCCTRLn.ONDE
MAND
XOSCTRLn.ENABL
E
Sleep Behavior
- - 0 Disabled
0 0 1 Always run in Idle Sleep modes.
Run in Standby Sleep mode if
requested by a peripheral.
0 1 1 Only run in Idle or Standby Sleep
modes if requested by a
peripheral.
SAM D5x/E5x Family Data Sheet
OSCCTRL – Oscillators Controller
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 766