CLOCK — Clock control

The clock control system can source the system clocks from a range of internal or external high and low frequency oscillators and distribute them to modules based upon a module’s individual requirements. Clock distribution is automated and grouped independently by module to limit current consumption in unused branches of the clock tree.

Listed here are the main features for CLOCK:

  • 64 MHz on-chip oscillator
  • 64 MHz crystal oscillator, using external 32 MHz crystal
  • 32.768 kHz +/-250 ppm RC oscillator
  • 32.768 kHz crystal oscillator, using external 32.768 kHz crystal
  • 32.768 kHz oscillator synthesized from 64 MHz oscillator
  • Firmware (FW) override control of oscillator activity for low latency start up
  • Automatic oscillator and clock control, and distribution for ultra-low power
Figure 1. Clock control

HFCLK clock controller

The HFCLK clock controller provides the following clocks to the system.

  • HCLK64M: 64 MHz CPU clock
  • PCLK1M: 1 MHz peripheral clock
  • PCLK16M: 16 MHz peripheral clock
  • PCLK32M: 32 MHz peripheral clock

The HFCLK controller supports the following high frequency clock (HFCLK) sources:

  • 64 MHz internal oscillator (HFINT)
  • 64 MHz crystal oscillator (HFXO)

For illustration, see Figure 1.

When the system requests one or more clocks from the HFCLK controller, the HFCLK controller will automatically provide them. If the system does not request any clocks provided by the HFCLK controller, the controller will enter a power saving mode.

These clocks are only available when the system is in ON mode. When the system enters ON mode, the internal oscillator (HFINT) clock source will automatically start to be able to provide the required HFCLK clock(s) for the system.

The HFINT will be used when HFCLK is requested and HFXO has not been started. The HFXO is started by triggering the HFCLKSTART task and stopped using the HFCLKSTOP task. A HFCLKSTARTED event will be generated when the HFXO has started and its frequency is stable.

The HFXO must be running to use the RADIO, NFC module or the calibration mechanism associated with the 32.768 kHz RC oscillator.

64 MHz crystal oscillator (HFXO)

The 64 MHz crystal oscillator (HFXO) is controlled by a 32 MHz external crystal

The crystal oscillator is designed for use with an AT-cut quartz crystal in parallel resonant mode. To achieve correct oscillation frequency, the load capacitance must match the specification in the crystal data sheet.

Figure 2 shows how the 32 MHz crystal is connected to the 64 MHz crystal oscillator.

Figure 2. Circuit diagram of the 64 MHz crystal oscillator

The load capacitance (CL) is the total capacitance seen by the crystal across its terminals and is given by:



C1 and C2 are ceramic SMD capacitors connected between each crystal terminal and ground. For more information, see Reference circuitry. Cpcb1 and Cpcb2 are stray capacitances on the PCB. Cpin is the pin input capacitance on the XC1 and XC2 pins. See table 64 MHz crystal oscillator (HFXO). The load capacitors C1 and C2 should have the same value.

For reliable operation, the crystal load capacitance, shunt capacitance, equivalent series resistance, and drive level must comply with the specifications in table 64 MHz crystal oscillator (HFXO). It is recommended to use a crystal with lower than maximum load capacitance and/or shunt capacitance. A low load capacitance will reduce both start up time and current consumption.

LFCLK clock controller

The system supports several low frequency clock sources.

As illustrated in Figure 1, the system supports the following low frequency clock sources:

  • 32.768 kHz RC oscillator (LFRC)
  • 32.768 kHz crystal oscillator (LFXO)
  • 32.768 kHz synthesized from HFCLK (LFSYNT)

The LFCLK clock is started by first selecting the preferred clock source in register LFCLKSRC and then triggering the LFCLKSTART task. If the LFXO is selected as the clock source, the LFCLK will initially start running from the 32.768 kHz LFRC while the LFXO is starting up and automatically switch to using the LFXO once this oscillator is running. The LFCLKSTARTED event will be generated when the LFXO has been started.

The LFCLK clock is stopped by triggering the LFCLKSTOP task.

It is not allowed to write to register LFCLKSRC when the LFCLK is running.

A LFCLKSTOP task will stop the LFCLK oscillator. However, the LFCLKSTOP task can only be triggered after the STATE field in register LFCLKSTAT indicates a 'LFCLK running' state.

The LFCLK clock controller and all of the LFCLK clock sources are always switched off when in OFF mode.

32.768 kHz RC oscillator (LFRC)

The default source of the low frequency clock (LFCLK) is the 32.768 kHz RC oscillator (LFRC).

The LFRC frequency will be affected by variation in temperature. The LFRC oscillator can be calibrated to improve accuracy by using the HFXO as a reference oscillator during calibration. See Table 32.768 kHz RC oscillator (LFRC) for details on the default and calibrated accuracy of the LFRC oscillator. The LFRC oscillator does not require additional external components.

Calibrating the 32.768 kHz RC oscillator

After the 32.768 kHz RC oscillator is started and running, it can be calibrated by triggering the CAL task. In this case, the HFCLK will be temporarily switched on and used as a reference.

A DONE event will be generated when calibration has finished. The calibration mechanism will only work as long as HFCLK is generated from the HFCLK crystal oscillator, it is therefore necessary to explicitly start this crystal oscillator before calibration can be started, see HFCLKSTART task.

Calibration timer

The calibration timer can be used to time the calibration interval of the 32.768 kHz RC oscillator.

The calibration timer is started by triggering the CTSTART task and stopped by triggering the CTSTOP task. The calibration timer will always start counting down from the value specified in CTIV and generate a CTTO timeout event when it reaches 0. The Calibration timer will stop by itself when it reaches 0.

Figure 3. Calibration timer

Due to limitations in the calibration timer, only one task related to calibration, that is, CAL, CTSTART and CTSTOP, can be triggered for every period of LFCLK.

32.768 kHz crystal oscillator (LFXO)

For higher LFCLK accuracy (when better than +/- 250 ppm accuracy is required), the low frequency crystal oscillator (LFXO) must be used.

The following external clock sources are supported:

  • Low swing clock signal applied to the XL1 pin. The XL2 pin shall then be grounded.
  • Rail-to-rail clock signal applied to the XL1 pin. The XL2 pin shall then be grounded or left unconnected.

The LFCLKSRC register controls the clock source, and its allowed swing. The truth table for various situations is as follows:

Table 1. LFCLKSRC configuration depending on clock source
SRCEXTERNALBYPASSComment
000Normal operation, RC is source
001DO NOT USE
01XDO NOT USE
100Normal XTAL operation
110Apply external low swing signal to XL1, ground XL2
111Apply external full swing signal to XL1, leave XL2 grounded or unconnected
101DO NOT USE
200Normal operation, synth is source
201DO NOT USE
21XDO NOT USE

To achieve correct oscillation frequency, the load capacitance must match the specification in the crystal data sheet. Figure 4 shows the LFXO circuitry.

Figure 4. Circuit diagram of the 32.768 kHz crystal oscillator

The load capacitance (CL) is the total capacitance seen by the crystal across its terminals and is given by:



C1 and C2 are ceramic SMD capacitors connected between each crystal terminal and ground. Cpcb1 and Cpcb2 are stray capacitances on the PCB. Cpin is the pin input capacitance on the XC1 and XC2 pins (see 32.768 kHz crystal oscillator (LFXO)). The load capacitors C1 and C2 should have the same value.

For more information, see Reference circuitry.

32.768 kHz synthesized from HFCLK (LFSYNT)

LFCLK can also be synthesized from the HFCLK clock source. The accuracy of LFCLK will then be the accuracy of the HFCLK.

Using the LFSYNT clock avoids the requirement for a 32.768 kHz crystal, but increases average power consumption as the HFCLK will need to be requested in the system.

Registers

Table 2. Instances
Base addressPeripheralInstanceDescriptionConfiguration
0x40000000CLOCKCLOCKClock control  
Table 3. Register Overview
RegisterOffsetDescription
TASKS_HFCLKSTART0x000Start HFCLK crystal oscillator 
TASKS_HFCLKSTOP0x004Stop HFCLK crystal oscillator 
TASKS_LFCLKSTART0x008Start LFCLK source 
TASKS_LFCLKSTOP0x00CStop LFCLK source 
TASKS_CAL0x010Start calibration of LFRC oscillator 
TASKS_CTSTART0x014Start calibration timer 
TASKS_CTSTOP0x018Stop calibration timer 
EVENTS_HFCLKSTARTED0x100HFCLK oscillator started 
EVENTS_LFCLKSTARTED0x104LFCLK started 
EVENTS_DONE0x10CCalibration of LFCLK RC oscillator complete event 
EVENTS_CTTO0x110Calibration timer timeout 
INTENSET0x304Enable interrupt 
INTENCLR0x308Disable interrupt 
HFCLKRUN0x408Status indicating that HFCLKSTART task has been triggered 
HFCLKSTAT0x40CHFCLK status 
LFCLKRUN0x414Status indicating that LFCLKSTART task has been triggered 
LFCLKSTAT0x418LFCLK status 
LFCLKSRCCOPY0x41CCopy of LFCLKSRC register, set when LFCLKSTART task was triggered 
LFCLKSRC0x518Clock source for the LFCLK 
CTIV0x538Calibration timer intervalRetained
TRACECONFIG0x55CClocking options for the Trace Port debug interface 

INTENSET

Address offset: 0x304

Enable interrupt

Bit number313029282726252423222120191817161514131211109876543210
Id                           DC BA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARWHFCLKSTARTED  

Write '1' to Enable interrupt for HFCLKSTARTED event

See EVENTS_HFCLKSTARTED

   Set1Enable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
BRWLFCLKSTARTED  

Write '1' to Enable interrupt for LFCLKSTARTED event

See EVENTS_LFCLKSTARTED

   Set1Enable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
CRWDONE  

Write '1' to Enable interrupt for DONE event

See EVENTS_DONE

   Set1Enable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
DRWCTTO  

Write '1' to Enable interrupt for CTTO event

See EVENTS_CTTO

   Set1Enable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
 

INTENCLR

Address offset: 0x308

Disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
Id                           DC BA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARWHFCLKSTARTED  

Write '1' to Disable interrupt for HFCLKSTARTED event

See EVENTS_HFCLKSTARTED

   Clear1Disable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
BRWLFCLKSTARTED  

Write '1' to Disable interrupt for LFCLKSTARTED event

See EVENTS_LFCLKSTARTED

   Clear1Disable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
CRWDONE  

Write '1' to Disable interrupt for DONE event

See EVENTS_DONE

   Clear1Disable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
DRWCTTO  

Write '1' to Disable interrupt for CTTO event

See EVENTS_CTTO

   Clear1Disable
   Disabled0Read: Disabled
   Enabled1Read: Enabled
 

HFCLKRUN

Address offset: 0x408

Status indicating that HFCLKSTART task has been triggered

Bit number313029282726252423222120191817161514131211109876543210
Id                               A
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARSTATUS  HFCLKSTART task triggered or not
   NotTriggered0Task not triggered
   Triggered1Task triggered
 

HFCLKSTAT

Address offset: 0x40C

HFCLK status

Bit number313029282726252423222120191817161514131211109876543210
Id               B               A
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARSRC  Source of HFCLK
   RC064 MHz internal oscillator (HFINT)
   Xtal164 MHz crystal oscillator (HFXO)
BRSTATE  HFCLK state
   NotRunning0HFCLK not running
   Running1HFCLK running
 

LFCLKRUN

Address offset: 0x414

Status indicating that LFCLKSTART task has been triggered

Bit number313029282726252423222120191817161514131211109876543210
Id                               A
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARSTATUS  LFCLKSTART task triggered or not
   NotTriggered0Task not triggered
   Triggered1Task triggered
 

LFCLKSTAT

Address offset: 0x418

LFCLK status

Bit number313029282726252423222120191817161514131211109876543210
Id               B              AA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARSRC  Source of LFCLK
   RC032.768 kHz RC oscillator
   Xtal132.768 kHz crystal oscillator
   Synth232.768 kHz synthesized from HFCLK
BRSTATE  LFCLK state
   NotRunning0LFCLK not running
   Running1LFCLK running
 

LFCLKSRCCOPY

Address offset: 0x41C

Copy of LFCLKSRC register, set when LFCLKSTART task was triggered

Bit number313029282726252423222120191817161514131211109876543210
Id                              AA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARSRC  Clock source
   RC032.768 kHz RC oscillator
   Xtal132.768 kHz crystal oscillator
   Synth232.768 kHz synthesized from HFCLK
 

LFCLKSRC

Address offset: 0x518

Clock source for the LFCLK

Bit number313029282726252423222120191817161514131211109876543210
Id              CB              AA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARWSRC  Clock source
   RC032.768 kHz RC oscillator
   Xtal132.768 kHz crystal oscillator
   Synth232.768 kHz synthesized from HFCLK
BRWBYPASS  Enable or disable bypass of LFCLK crystal oscillator with external clock source
   Disabled0Disable (use with Xtal or low-swing external source)
   Enabled1Enable (use with rail-to-rail external source)
CRWEXTERNAL  Enable or disable external source for LFCLK
   Disabled0Disable external source (use with Xtal)
   Enabled1Enable use of external source instead of Xtal (SRC needs to be set to Xtal)
 

CTIV ( Retained )

Address offset: 0x538

This register is a retained register

Calibration timer interval

Bit number313029282726252423222120191817161514131211109876543210
Id                         AAAAAAA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARWCTIV  Calibration timer interval in multiple of 0.25 seconds. Range: 0.25 seconds to 31.75 seconds.
 

TRACECONFIG

Address offset: 0x55C

Clocking options for the Trace Port debug interface

This register is a retained register. Reset behavior is the same as debug components.

Bit number313029282726252423222120191817161514131211109876543210
Id              BB              AA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARWTRACEPORTSPEED  Speed of Trace Port clock. Note that the TRACECLK pin will output this clock divided by two.
   32MHz032 MHz Trace Port clock (TRACECLK = 16 MHz)
   16MHz116 MHz Trace Port clock (TRACECLK = 8 MHz)
   8MHz28 MHz Trace Port clock (TRACECLK = 4 MHz)
   4MHz34 MHz Trace Port clock (TRACECLK = 2 MHz)
BRWTRACEMUX  Pin multiplexing of trace signals.
   GPIO0GPIOs multiplexed onto all trace-pins
   Serial1SWO multiplexed onto P0.18, GPIO multiplexed onto other trace pins
   Parallel2TRACECLK and TRACEDATA multiplexed onto P0.20, P0.18, P0.16, P0.15 and P0.14.
 

Electrical specification

64 MHz internal oscillator (HFINT)

SymbolDescriptionMin.Typ.Max.Units
fNOM_HFINTNominal output frequency64MHz
fTOL_HFINTFrequency tolerance<±1.5<±6%
IHFINTRun current60µA
ISTART_HFINTAverage startup currentI_HFINTµA
tSTART_HFINTStartup time3us

64 MHz crystal oscillator (HFXO)

SymbolDescriptionMin.Typ.Max.Units
fNOM_HFXONominal output frequency64MHz
fXTAL_HFXOExternal crystal frequency32MHz
fTOL_HFXOFrequency tolerance requirement for 2.4 GHz proprietary radio applications±60ppm
fTOL_HFXO_BLEFrequency tolerance requirement, Bluetooth low energy applications±40ppm
CL_HFXOLoad capacitance12pF
C0_HFXOShunt capacitance7pF
RS_HFXO_7PFEquivalent series resistance C0 = 7 pF60ohm
RS_HFXO_5PFEquivalent series resistance C0 = 5 pF80ohm
RS_HFXO_3PFEquivalent series resistance C0 = 3 pF100ohm
PD_HFXODrive level100uW
CPIN_HFXOInput capacitance XC1 and XC24pF
ISTBY_X32MCore standby current150µA
IHFXORun current250µA
ISTART_HFXOAverage startup current, first 1 ms0.4mA
tSTART_HFXOStartup time0.36ms

32.768 kHz RC oscillator (LFRC)

SymbolDescriptionMin.Typ.Max.Units
fNOM_LFRCNominal frequency32.768kHz
fTOL_LFRCFrequency tolerance±2%
fTOL_CAL_LFRCFrequency tolerance for LFRC after calibration2±250ppm
ILFRCRun current for 32.768 kHz RC oscillator0.61µA
tSTART_LFRCStartup time for 32.768 kHz RC oscillator600us

32.768 kHz crystal oscillator (LFXO)

SymbolDescriptionMin.Typ.Max.Units
fNOM_LFXOCrystal frequency32.768kHz
fTOL_LFXO_BLEFrequency tolerance requirement for BLE stack±250ppm
fTOL_LFXO_ANTFrequency tolerance requirement for ANT stack±50ppm
CL_LFXOLoad capacitance12.5pF
C0_LFXOShunt capacitance2pF
RS_LFXOEquivalent series resistance100kohm
PD_LFXODrive level1uW
CpinInput capacitance on XL1 and XL2 pads4pF
ILFXORun current for 32.768 kHz crystal oscillator0.25µA
tSTART_LFXOStartup time for 32.768 kHz crystal oscillator0.25s
VAMP_IN_XO_LOWPeak to peak amplitude for external low swing clock. Input signal must not swing outside supply rails.2001000mV

32.768 kHz synthesized from HFCLK (LFSYNT)

SymbolDescriptionMin.Typ.Max.Units
fNOM_LFSYNTNominal frequency32.768kHz
fTOL_LFSYNTFrequency tolerance in addition to HFLCK tolerance38ppm
ILFSYNTRun current for synthesized 32.768 kHz100µA
tSTART_LFSYNTStartup time for synthesized 32.768 kHz100us
1 Current drawn if HFXO is forced on through for instance using the low latency power mode.
2 Constant temperature within ±0.5 °C and calibration performed at least every 8 seconds
3 Frequency tolerance will be derived from the HFCLK source clock plus the LFSYNT tolerance