2.15. Clocks

2.15.1. Overview

The clocks block provides independent clocks to on-chip and external components. It takes inputs from a variety of clock sources allowing the user to trade off performance against cost, board area and power consumption. From these sources it uses multiple clock generators to provide the required clocks. This architecture allows the user flexibility to start and stop clocks independently and to vary some clock frequencies whilst maintaining others at their optimum frequencies.

Figure 28. Clocks overview

Figure 28: Clocks overview diagram. The diagram shows the clock architecture of the RP2040. On the left, 'Clock sources' include 'External clocks or Relaxation oscillators' (connected to 'GPCLK0 - 1 from GPIO Muxing'), 'USB PLL', 'System PLL', 'Crystal Oscillator (XOSC)', and 'Ring Oscillator (ROSC)'. These sources feed into a central 'Clocks' block. This block contains seven multiplexers, each followed by a divider and an enable ('en') block. The outputs are: 'clk_gpout0-3' to 'GPIO Muxing', 'clk_adc' to 'ADC', 'clk_usb' to 'USB', 'clk_rtc' to 'RTC', 'clk_peri' to 'UART+SPI', 'clk_sys' to 'Processors, Bus fabric, Memories & Memory-mapped registers', and 'clk_ref' to 'Watchdog & Timers'. Additionally, the 'Clocks' block contains a 'Frequency counter' and a 'Resus' block, both connected to the 'clk_ref' output.
Figure 28: Clocks overview diagram. The diagram shows the clock architecture of the RP2040. On the left, 'Clock sources' include 'External clocks or Relaxation oscillators' (connected to 'GPCLK0 - 1 from GPIO Muxing'), 'USB PLL', 'System PLL', 'Crystal Oscillator (XOSC)', and 'Ring Oscillator (ROSC)'. These sources feed into a central 'Clocks' block. This block contains seven multiplexers, each followed by a divider and an enable ('en') block. The outputs are: 'clk_gpout0-3' to 'GPIO Muxing', 'clk_adc' to 'ADC', 'clk_usb' to 'USB', 'clk_rtc' to 'RTC', 'clk_peri' to 'UART+SPI', 'clk_sys' to 'Processors, Bus fabric, Memories & Memory-mapped registers', and 'clk_ref' to 'Watchdog & Timers'. Additionally, the 'Clocks' block contains a 'Frequency counter' and a 'Resus' block, both connected to the 'clk_ref' output.

For very low cost or low power applications where precise timing is not required, the chip can be run from the internal Ring Oscillator (ROSC). Alternatively the user can provide external clocks or construct simple relaxation oscillators using the GPIOs and appropriate external passive components. Where timing is more critical, the Crystal Oscillator (XOSC) can provide an accurate reference to the 2 on-chip PLLs to provide fast clocking at precise frequencies.

The clock generators select from the clock sources and optionally divide the selected clock before outputting through enable logic which provides automatic clock disabling in SLEEP mode (see Section 2.11.2 ).

An on-chip frequency counter facilitates debugging of the clock setup and also allows measurement of the frequencies of external clocks. The on-chip resus component restarts the system clock from a known good clock if it is accidentally stopped. This allows the software debugger to access registers and debug the problem.

The chip has an ultra-low power mode called DORMANT (see Section 2.11.3 ) in which all on-chip clock sources are stopped to save power. External sources are not stopped and can be used to provide a clock to the on-chip RTC which can provide an alarm to wake the chip from DORMANT mode. Alternatively the GPIO interrupts can be configured to wake the chip from DORMANT mode in response to an external event.

Up to 4 generated clocks can be output to GPIOs at up to 50MHz. This allows the user to supply clocks to external devices, thus reducing component counts in power, space and cost sensitive applications.

2.15.2. Clock sources

The RP2040 can be run from a variety of clock sources. This flexibility allows the user to optimise the clock setup for performance, cost, board area and power consumption. The sources include the on-chip Ring Oscillator ( Section 2.17 ), the Crystal Oscillator ( Section 2.16 ), external clocks from GPIOs ( Section 2.15.6.4 ) and the PLLs ( Section 2.18 ).

The list of clock sources is different per clock generator and can be found as enumerated values in the CTRL register. See CLK_SYS_CTRL as an example.

2.15.2.1. Ring Oscillator

The on-chip Ring Oscillator ( Section 2.17 ) requires no external components. It runs automatically from power-up and is used to clock the chip during the initial boot stages. The startup frequency is typically 6MHz but varies with PVT (Process, Voltage and Temperature). The frequency is likely to be in the range 4-8MHz and is guaranteed to be in the range 1.8-12MHz.

For low cost applications where frequency accuracy is unimportant, the chip can continue to run from the ROSC. If greater performance is required the frequency can be increased by programming the registers as described in Section 2.17 . The frequency will vary with PVT (Process, Voltage and Temperature) so the user must take care to avoid exceeding the maximum frequencies described in the clock generators section. This variation can be mitigated in various ways (see Section 2.15.2.1.1 ) if the user wants to continue running from the ROSC at a frequency close to the maximum. Alternatively, the user can use an external clock or the XOSC to provide a stable reference clock and use the PLLs to generate higher frequencies. This will require external components, which will cost board area and increase power consumption.

If an external clock or the XOSC is used then the ROSC can be stopped to save power. However, the reference clock generator and the system clock generator must be switched to an alternate source before doing so.

The ROSC is not affected by SLEEP mode. If required the frequency can be reduced before entering SLEEP mode to save power. On entering DORMANT mode the ROSC is automatically stopped and is restarted in the same configuration when exiting DORMANT mode. If the ROSC is driving clocks at close to their maximum frequencies then it is recommended to drop the frequency before entering SLEEP or DORMANT mode to allow for frequency variation due to changes in environmental conditions during SLEEP or DORMANT mode.

If the user wants to use the ROSC clock externally then it can be output to a GPIO pin using one of the clk_gpclk0-3 generators.

The following sections describe techniques for mitigating PVT variation of the ROSC frequency. They also provide some interesting design challenges for use in teaching both the effects of PVT and writing software to control real time functions.

Note icon NOTE

The ROSC frequency varies with PVT so the user can send its output to the frequency counter and use it to measure any 1 of these 3 variables if the other 2 are known.

2.15.2.1.1. Mitigating ROSC frequency variation due to process

Process varies for two reasons. Firstly, chips leave the factory with a spread of process parameters which cause variation in the ROSC frequency across chips. Secondly, process parameters vary slightly as the chip ages, though this will only be observable over many thousands of hours of operation. To mitigate for process variation, the user can characterise individual chips and program the ROSC frequency accordingly. This is an adequate solution for small numbers of chips but is not suitable for volume production. In such applications the user should consider using the automatic mitigation techniques described below.

2.15.2.1.2. Mitigating ROSC frequency variation due to voltage

Supply voltage varies for two reasons. Firstly, the power supply itself may vary, and secondly, there will be varying on-chip IR drop as chip activity varies. If the application has a minimum performance target then the user needs to calibrate for that application and adjust the ROSC frequency to ensure it always exceeds the minimum required.

2.15.2.1.3. Mitigating ROSC frequency variation due to temperature

Temperature varies for two reasons. Firstly, the ambient temperature may vary, and secondly, the chip temperature will vary as chip activity varies due to self-heating. This can be mitigated by stabilising the temperature using a temperature

controlled environment and passive or active cooling. Alternatively the user can track the temperature using the on-chip temperature sensor and adjust the ROSC frequency so it remains within the required bounds.

2.15.2.1.4. Automatic mitigation of ROSC frequency variation due to PVT

Techniques for automatic ROSC frequency control avoid the need to calibrate individual chips but require periodic access to a clock reference or to a time reference. If a clock reference is available then it can be used to periodically measure the ROSC frequency and adjust it accordingly. The reference could be the on-chip XOSC which can be turned on periodically for this purpose. This may be useful in a very low power application where it is too costly to run the XOSC continuously and too costly to use the PLLs to achieve high frequencies. If a time reference is available then the user could clock the on-chip RTC from the ROSC and periodically compare it against the time reference, then adjust the ROSC frequency as necessary. Using these techniques the ROSC frequency will drift due to VT variation so the user must take care that these variations do not allow the ROSC frequency to drift out of the acceptable range.

2.15.2.1.5. Automatic overclocking using the ROSC

The datasheet maximum frequencies for any digital device are quoted for worst case PVT. Most chips in most normal environments can run significantly faster than the quoted maximum and can therefore be overclocked. If the RP2040 is running from the ROSC then both the ROSC and the digital components are similarly affected by PVT, so, as the ROSC gets faster, the processors can also run faster. This means the user can overclock from the ROSC then rely on the ROSC frequency tracking with PVT variations. The tracking of ROSC frequency and the processor capability is not perfect and currently there is insufficient data to specify a safe ROSC setting for this mode of operation, so some experimentation is required.

This mode of operation will maximise processor performance but will lead to variations in the time taken to complete a task, which may be unacceptable in some applications. Also, if the user wants to use frequency sensitive interfaces such as USB or UART then the XOSC and PLL must be used to provide a precise clock for those components.

2.15.2.2. Crystal Oscillator

The Crystal Oscillator ( Section 2.16 ) provides a precise, stable clock reference and should be used where accurate timing is required and no suitable external clocks are available. The frequency is determined by the external crystal and the oscillator supports frequencies in the range 1MHz to 15MHz. The on-chip PLLs can be used to synthesise higher frequencies if required. The RP2040 reference design (see the Minimal Design Example in Hardware design with RP2040 ) uses a 12MHz crystal. Using the XOSC and the PLLs, the on-chip components can be run at their maximum frequencies. Appropriate margin is built into the design to tolerate up to 1000ppm variation in the XOSC frequency.

The XOSC is inactive on power up. If required it must be enabled in software. XOSC startup takes several milliseconds and the software must wait for the XOSC_STABLE flag to be set before starting the PLLs and before changing any clock generators to use it. Prior to that the output from the XOSC may be non-existent or may have very short pulse widths which will corrupt logic if used. Once it is running the reference clock (clk_ref) and the system clock (clk_sys) can be switched to run from the XOSC and the ROSC can be stopped to save power.

The XOSC is not affected by SLEEP mode. It is automatically stopped and restarted in the same configuration when entering and exiting DORMANT mode.

If the user wants to use the XOSC clock externally then it can be output to a GPIO pin using one of the clk_gpclk0-3 generators. It cannot be taken directly from the XIN or XOUT pins.

2.15.2.3. External Clocks

If external clocks exist in your hardware design then they can be used to clock the RP2040 either on their own or in conjunction with the XOSC or ROSC. This will potentially save power and will allow components on the RP2040 to be run synchronously with external components to simplify data transfer between chips. External clocks can be input on the

GPIN0 & GPIN1 GPIO inputs and on the XIN input to the XOSC. If the XIN input is used in this way the XOSC must be configured to pass through the XIN signal. All 3 inputs are limited to 50MHz but the on-chip PLLs can be used to synthesise higher frequencies from the XIN input if required. If the frequency accuracy of the external clocks is poorer than 1000ppm then the generated clocks should not be run at their maximum frequencies because they may exceed their design margins.

Once the external clocks are running, the reference clock (clk_ref) and the system clock (clk_sys) can be switched to run from the external clocks and the ROSC can be stopped to save power.

The external clock sources are not affected by SLEEP mode or DORMANT mode.

2.15.2.4. Relaxation Oscillators

If the user wants to use external clocks to replace or supplement the other clock sources but does not have an appropriate clock available, then 1 or 2 relaxation oscillators can be constructed using external passive components. Simply send the clock source (GPIN0 or GPIN1) to one of the gpclk0-3 generators, invert it through the GPIO inverter OUTOVER and connect back to the clock source input via an RC circuit.

Figure 29. Simple relaxation oscillator example

Circuit diagram of a simple relaxation oscillator. A feedback loop starts from a GPIO pin (GPIN0 from GPIO Muxing), goes through a divider (÷1), then through the gpclk0 generator, then through an inverter (OUTOVER), and finally through an RC circuit (resistor and capacitor) before returning to the GPIO pin input.
Circuit diagram of a simple relaxation oscillator. A feedback loop starts from a GPIO pin (GPIN0 from GPIO Muxing), goes through a divider (÷1), then through the gpclk0 generator, then through an inverter (OUTOVER), and finally through an RC circuit (resistor and capacitor) before returning to the GPIO pin input.

The frequency of clocks generated from relaxation oscillators will depend on the delay through the chip and the drive current from the GPIO output both of which vary with PVT. They will also depend on the quality and accuracy of the external components. It may be possible to improve the frequency accuracy using more elaborate external components such as ceramic resonators but that will increase cost and complexity and can never rival the XOSC. For that reason they are not discussed here. Given that these oscillators will not achieve 1000ppm then they cannot be used to drive internal clocks at their maximum frequencies.

The relaxation oscillators are not affected by SLEEP mode or DORMANT mode.

2.15.2.5. PLLs

The PLLs ( Section 2.18 ) are used to provide fast clocks when running from the XOSC (or an external clock source driven into the XIN pin). In a fully featured application the USB PLL provides a fixed 48MHz clock to the ADC and USB while clk_rtc and clk_ref are driven from the XOSC or external source. This allows the user to drive clk_sys from the system PLL and vary the frequency according to demand to save power without having to change the setups of the other clocks. clk_peri can be driven either from the fixed frequency USB PLL or from the variable frequency system PLL. If clk_sys never needs to exceed 48MHz then one PLL can be used and the divider in the clk_sys clock generator can be used to scale the clk_sys frequency according to demand.

When a PLL is started, its output cannot be used until the PLL locks as indicated by the LOCK bit in the STATUS register. Thereafter the PLL output cannot be used during changes to the reference clock divider, the output dividers or the bypass mode. The output can be used during feedback divisor changes with the proviso that the output frequency may overshoot or undershoot on large changes to the feedback divisor. For more information, see Section 2.18 .

If the PLL reference clock is accurate to 1000ppm then the PLLs can be used to drive clocks at their maximum frequency because the frequency of the generated clocks will be within the margins allowed in the design.

The PLLs are not affected by SLEEP mode. If the user wants to save power in SLEEP mode then all clock generators must be switched away from the PLLs and they must be stopped in software before entering SLEEP mode. The PLLs are not stopped and restarted automatically when entering and exiting DORMANT mode. If they are left running on entry to DORMANT mode they will be corrupted and will generate out of control clocks that will consume power unnecessarily. This happens because their reference clock from XOSC will be stopped. It is therefore essential to switch all clock generators away from the PLLs and stop the PLLs in software before entering DORMANT mode.

2.15.3. Clock Generators

The clock generators are built on a standard design which incorporates clock source multiplexing, division, duty cycle correction and SLEEP mode enabling. To save chip area and power, the individual clock generators do not support all features.

Figure 30. A generic clock generator

Block diagram of a generic clock generator. It starts with 'clock sources' entering a multiplexer. The output of the multiplexer goes through a 'Glitchless' block. The output then enters a 'Divider' block, which has a 'Divider enable' input. The output of the divider goes through a 'Duty cycle correction' block. The output of the duty cycle correction block goes through a 'Wake and Sleep enable' block. The final output is the 'Generated clock'.
graph LR
    CS[clock sources] --> MUX[multiplexer]
    MUX --> G[Glitchless]
    G --> D[Divider]
    DE[Divider enable] --> D
    D --> DCC[Duty cycle correction]
    DCC --> WSE[Wake and Sleep enable]
    WSE --> GC[Generated clock]
Block diagram of a generic clock generator. It starts with 'clock sources' entering a multiplexer. The output of the multiplexer goes through a 'Glitchless' block. The output then enters a 'Divider' block, which has a 'Divider enable' input. The output of the divider goes through a 'Duty cycle correction' block. The output of the duty cycle correction block goes through a 'Wake and Sleep enable' block. The final output is the 'Generated clock'.

2.15.3.1. Instances

RP2040 has several clock generators which are listed below.

Table 205. RP2040 clock generators

ClockDescriptionNominal Frequency
clk_gpout0Clock output to GPIO. Can be used to clock external devices or debug on chip clocks with a logic analyser or oscilloscope.N/A
clk_gpout1
clk_gpout2
clk_gpout3
clk_refReference clock that is always running unless in DORMANT mode. Runs from Ring Oscillator (ROSC) at power-up but can be switched to Crystal Oscillator (XOSC) for more accuracy.6 - 12MHz
clk_sysSystem clock that is always running unless in DORMANT mode. Runs from clk_ref at power-up but is typically switched to a PLL.125MHz
clk_periPeripheral clock. Typically runs from clk_sys but allows peripherals to run at a consistent speed if clk_sys is changed by software.12 - 125MHz
clk_usbUSB reference clock. Must be 48MHz.48MHz
clk_adcADC reference clock. Must be 48MHz.48MHz
clk_rtcRTC reference clock. The RTC divides this clock to generate a 1 second reference.46875Hz

i NOTE

clk_sys (and clk_peri ) have a maximum frequency of 133MHz across all process, voltage and temperature variations. You can achieve 200MHz by running at an elevated core supply (DVDD) and setting VREG VSEL to 1.15V. For more information, see Section 2.10.6 .

For a full list of clock sources for each clock generator see the appropriate CTRL register. For example, CLK_SYS_CTRL .

2.15.3.2. Multiplexers

All clock generators have a multiplexer referred to as the auxiliary (aux) mux. This mux has a conventional design whose output will glitch when changing the select control. Two clock generators ( clk_sys and clk_ref) have an additional multiplexer, referred to as the glitchless mux. The glitchless mux can switch between clock sources without generating a glitch on the output.

Clock glitches should be avoided at all costs because they may corrupt the logic running on that clock. This means that any clock generator with only an aux mux must be disabled while switching the clock source. If the clock generator has a glitchless mux ( clk_sys and clk_ref), then the glitchless mux should switch away from the aux mux while changing the aux mux source. The clock generators require 2 cycles of the source clock to stop the output and 2 cycles of the new source to restart the output. The user must wait for the generator to stop before changing the auxiliary mux, and therefore must be aware of the source clock frequency.

The glitchless mux is only implemented for always-on clocks. On RP2040 the always-on clocks are the reference clock ( clk_ref) and the system clock ( clk_sys). Such clocks must run continuously unless the chip is in DORMANT mode. The glitchless mux has a status output (SELECTED) which indicates which source is selected and can be read from software to confirm that a change of clock source has been completed.

The recommended control sequences are as follows.

To switch the glitchless mux:

To switch the auxiliary mux when the generator has a glitchless mux:

To switch the auxiliary mux when the generator does not have a glitchless mux:

See Section 2.15.6.1 for a code example of this.

2.15.3.3. Divider

A fully featured divider divides by 1 or a fractional number in the range 2.0 to \( 2^{24} \cdot 0.01 \) . Fractional division is achieved by toggling between 2 integer divisors therefore it yields a jittery clock which may not be suitable for some applications. For example, when dividing by 2.4 the divider will divide by 2 for 3 cycles and by 3 for 2 cycles. For divisors with large integer components the jitter will be much smaller and less critical.

Figure 31. An example of fractional division.

Timing diagram for fractional division showing clock source and generated clock with divisors 2, 3, and 2.4.

A timing diagram illustrating fractional division. It shows a 'Clock source' as a regular square wave. Below it, the 'Generated clock' is shown as a square wave that changes its period. Horizontal arrows indicate the division factors: 'Divide by 2' for the first segment, 'Divide by 3' for the second segment, and 'Divide by 2.4' for the third segment. The generated clock's period increases when the divisor increases and decreases when the divisor decreases.

Timing diagram for fractional division showing clock source and generated clock with divisors 2, 3, and 2.4.

All dividers support on-the-fly divisor changes meaning the output clock will switch cleanly from one divisor to another. The clock generator does not need to be stopped during clock divisor changes. It does this by synchronising the divisor change to the end of the clock cycle. Similarly, the enable is synchronised to the end of the clock cycle so will not generate glitches when the clock generator is enabled or disabled. Clock generators for always-on clocks are permanently enabled and therefore do not have an enable control.

In the event that a clock generator locks up and never completes the current clock cycle it can be forced to stop using the KILL control. This may result in an output glitch which may corrupt the logic driven by the clock. It is therefore recommended the destination logic is reset prior to this operation. It is worth mentioning that this clock generator design has been used in numerous chips and has never been known to lock up. The KILL control is inelegant and unnecessary and should not be used as an alternative to the enable. Clock generators for always-on clocks are permanently active and therefore do not have a KILL control.

2.15.3.4. Duty Cycle Correction

The divider operates on the rising edge of the input clock and so does not generate an even duty cycle clock when dividing by odd numbers.

Divide by 3 will give a duty cycle of 33.3%, divide by 5 will be 40% etc. If enabled, the duty cycle correction logic will shift the falling edge of the output clock to the falling edge of the input clock and restore a 50% duty cycle. The duty cycle correction can be enabled and disabled while the clock is running. It will not operate when dividing by an even number.

Figure 32. An example of duty_cycle_correction.

Timing diagram for duty cycle correction showing clock source, generated clock without DCC, and generated clock with DCC.

A timing diagram illustrating duty cycle correction. It shows three waveforms: 'Clock source' (a regular square wave), 'Generated clock without DCC' (a square wave with a duty cycle less than 50%), and 'Generated clock with DCC' (a square wave with a 50% duty cycle). The 'Generated clock with DCC' waveform is shifted so that its falling edges align with the falling edges of the 'Clock source'.

Timing diagram for duty cycle correction showing clock source, generated clock without DCC, and generated clock with DCC.

2.15.3.5. Clock Enables

Each clock goes to multiple destinations and, with a few exceptions, there are 2 enables for each destination. The WAKE_EN registers are used to enable the clocks when the system is awake and the SLEEP_EN registers are used to enable the clocks when the system is in sleep mode. The purpose of these enables is to reduce power in the clock distribution networks for components that are not being used. It is worth noting that a component which is not clocked will retain its configuration so can be restarted quickly.

NOTE

The WAKE_EN and SLEEP_EN registers reset to 0x1, which means that by default all clocks are enabled. The programmer only needs to use this feature if they desire a low-power design.

2.15.3.5.1. Clock Enable Exceptions

The processor cores do not have clock enables because they require a clock at all times to manage their own power saving features.

clk_sys_busfabric cannot be disabled in wake mode because that would prevent the cores from accessing any chip registers, including those that control the clock enables.

clk_sys_clocks does not have a wake mode enable because disabling it would prevent the cores from accessing the clocks control registers.

The gpclks do not have clock enables.

2.15.3.5.2. System Sleep Mode

System sleep mode is entered automatically when both cores are in sleep and the DMA has no outstanding transactions. In system sleep mode, the clock enables described in the previous paragraphs are switched from the WAKE_EN registers to the SLEEP_EN registers. The intention is to reduce power consumed in the clock distribution networks when the chip is inactive. If the user has not configured the WAKE_EN and SLEEP_EN registers then system sleep will do nothing.

There is little value in using system sleep without taking other measures to reduce power before the cores are put to sleep. Things to consider include:

For maximum power saving when the chip is inactive, the user should consider DORMANT (see Section 2.11.3 ) mode in which clocks are sourced from the Crystal Oscillator and/or the Ring Oscillator and those clock sources are stopped.

2.15.4. Frequency Counter

The frequency counter measures the frequency of internal and external clocks by counting the clock edges seen over a test interval. The interval is defined by counting cycles of clk_ref which must be driven either from XOSC or from a stable external source of known frequency.

The user can pick between accuracy and test time using the FC0_INTERVAL register. Table 206 shows the trade off.

Table 206. Frequency Counter Test Interval vs Accuracy

Interval RegisterTest IntervalAccuracy
01µs2048kHz
12µs1024kHz
24µs512kHz
38µs256kHz
416µs128kHz
532µs64kHz
664µs32kHz
7125µs16kHz
8250µs8kHz
9500µs4kHz
101ms2kHz
112ms1kHz
124ms500Hz
138ms250Hz
Interval RegisterTest IntervalAccuracy
1416ms125Hz
1532ms62.5Hz

2.15.5. Resus

It is possible to write software that inadvertently stops clk_sys. This will normally cause an unrecoverable lock-up of the cores and the on-chip debugger, leaving the user unable to trace the problem. To mitigate against that, an automatic resuscitation circuit is provided which will switch clk_sys to a known good clock source if no edges are detected over a user-defined interval. The known good source is clk_ref which can be driven from the XOSC, ROSC or an external source.

The resus block counts edges on clk_sys during a timeout interval controlled by clk_ref, and forces clk_sys to be driven from clk_ref if no clk_sys edges are detected. The interval is programmable via CLK_SYS_RESUS_CTRL.

⚠ WARNING

There is no way for resus to revive the chip if clk_ref is also stopped.

To enable the resus, the programmer must set the timeout interval and then set the ENABLE bit in CLK_SYS_RESUS_CTRL. To detect a resus event, the CLK_SYS_RESUS interrupt must be enabled by setting the interrupt enable bit in INTE. The CLOCKS_DEFAULT_IRQ(see Section 2.3.2 ) must also be enabled at the processor.

Resus is intended as a debugging aid. The intention is for the user to trace the software error that triggered the resus, then correct the error and reboot. It is possible to continue running after a resus event by reconfiguring clk_sys then clearing the resus by writing the CLEAR bit in CLK_SYS_RESUS_CTRL. However, it should be noted that a resus can be triggered by clk_sys running more slowly than expected and that could result in a clk_sys glitch when resus is triggered. That glitch could corrupt the chip. This would be a rare event but is tolerable in a debugging scenario. However it is unacceptable in normal operation therefore it is recommended to only use resus for debug.

⚠ WARNING

Resus is a debugging aid and should not be used as a means of switching clocks in normal operation.

2.15.6. Programmer's Model

2.15.6.1. Configuring a clock generator

The SDK defines an enum of clocks:

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2040/hardware_structs/include/hardware/structs/clocks.h Lines 30 - 42

30 typedef enum clock_num_rp2040 {
31     clk_gpout0 = 0, ///< Select CLK_GPOUT0 as clock source
32     clk_gpout1 = 1, ///< Select CLK_GPOUT1 as clock source
33     clk_gpout2 = 2, ///< Select CLK_GPOUT2 as clock source
34     clk_gpout3 = 3, ///< Select CLK_GPOUT3 as clock source
35     clk_ref = 4,   ///< Select CLK_REF as clock source
36     clk_sys = 5,   ///< Select CLK_SYS as clock source
37     clk_peri = 6,  ///< Select CLK_PERI as clock source
38     clk_usb = 7,   ///< Select CLK_USB as clock source
39     clk_adc = 8,   ///< Select CLK_ADC as clock source
40     clk_rtc = 9,   ///< Select CLK_RTC as clock source
41     CLK_COUNT
42 } clock_num_t;

And also a struct to describe the registers of a clock generator:

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2040/hardware_structs/include/hardware/structs/clocks.h Lines 100 - 121

100 typedef struct {
101     _REG_(CLOCKS_CLK_GPOUT0_CTRL_OFFSET) // CLOCKS_CLK_GPOUT0_CTRL
102     // Clock control, can be changed on-the-fly (except for auxsrc)
103     // 0x00100000 [20]  NUDGE      (0) An edge on this signal shifts the phase of the
        output by...
104     // 0x00030000 [17:16] PHASE      (0x0) This delays the enable signal by up to 3 cycles
        of the...
105     // 0x00001000 [12]    DC50      (0) Enables duty cycle correction for odd divisors
106     // 0x00000800 [11]    ENABLE     (0) Starts and stops the clock generator cleanly
107     // 0x00000400 [10]    KILL      (0) Asynchronously kills the clock generator
108     // 0x000001e0 [8:5]   AUXSRC     (0x0) Selects the auxiliary clock source, will glitch
        when switching
109     io_rw_32 ctrl;
110
111     _REG_(CLOCKS_CLK_GPOUT0_DIV_OFFSET) // CLOCKS_CLK_GPOUT0_DIV
112     // Clock divisor, can be changed on-the-fly
113     // 0xffffffff00 [31:8] INT      (0x000001) Integer component of the divisor, 0 ->
        divide by 2^16
114     // 0x000000ff [7:0]   FRAC      (0x00) Fractional component of the divisor
115     io_rw_32 div;
116
117     _REG_(CLOCKS_CLK_GPOUT0_SELECTED_OFFSET) // CLOCKS_CLK_GPOUT0_SELECTED
118     // Indicates which SRC is currently selected by the glitchless mux (one-hot)
119     // 0xffffffff [31:0] CLK_GPOUT0_SELECTED (0x00000001) This slice does not have a
        glitchless mux (only the...
120     io_ro_32 selected;
121 } clock_hw_t;

To configure a clock, we need to know the following pieces of information:

The SDK provides clock_configure to configure a clock:

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_clocks/clocks.c Lines 40 - 133

40 static void clock_configure_internal(clock_handle_t clock, uint32_t src, uint32_t auxsrc,
    uint32_t actual_freq, uint32_t div) {
41     clock_hw_t *clock_hw = &clocks_hw->clk[clock];
42
43     // If increasing divisor, set divisor before source. Otherwise set source
44     // before divisor. This avoids a momentary overspeed when e.g. switching
45     // to a faster source and increasing divisor to compensate.
46     if (div > clock_hw->div)
47         clock_hw->div = div;
48
49     // If switching a glitchless slice (ref or sys) to an aux source, switch
50     // away from aux *first* to avoid passing glitches when changing aux mux.
51     // Assume (!!!) glitchless source 0 is no faster than the aux source.
52     if (has_glitchless_mux(clock) && src ==
        CLOCKS_CLK_SYS_CTRL_SRC_VALUE_CLKSRC_CLK_SYS_AUX) {
53         hw_clear_bits(&clock_hw->ctrl, CLOCKS_CLK_REF_CTRL_SRC_BITS);
54     while (!(clock_hw->selected & 1u))
55         tight_loop_contents();
56     }
57     // If no glitchless mux, cleanly stop the clock to avoid glitches
58     // propagating when changing aux mux. Note it would be a really bad idea
59     // to do this on one of the glitchless clocks (clk_sys, clk_ref).
60     else {
61         // Disable clock. On clk_ref and clk_sys this does nothing,
62         // all other clocks have the ENABLE bit in the same position.
63         hw_clear_bits(&clock_hw->ctrl, CLOCKS_CLK_GPOUT0_CTRL_ENABLE_BITS);
64         if (configured_freq[clock] > 0) {
65             // Delay for 3 cycles of the target clock, for ENABLE propagation.
66             // Note XOSC_COUNT is not helpful here because XOSC is not
67             // necessarily running, nor is timer...
68             uint delay_cyc = configured_freq[clk_sys] / configured_freq[clock] + 1;
69             busy_wait_at_least_cycles(delay_cyc * 3);
70         }
71     }
72
73     // Set aux mux first, and then glitchless mux if this clock has one
74     hw_write_masked(&clock_hw->ctrl,
75         (auxsrc << CLOCKS_CLK_SYS_CTRL_AUXSRC_LSB),
76         CLOCKS_CLK_SYS_CTRL_AUXSRC_BITS
77     );
78
79     if (has_glitchless_mux(clock)) {
80         hw_write_masked(&clock_hw->ctrl,
81             src << CLOCKS_CLK_REF_CTRL_SRC_LSB,
82             CLOCKS_CLK_REF_CTRL_SRC_BITS
83         );
84         while (!(clock_hw->selected & (1u << src)))
85             tight_loop_contents();
86     }
87
88     // Enable clock. On clk_ref and clk_sys this does nothing,
89     // all other clocks have the ENABLE bit in the same position.
90     hw_set_bits(&clock_hw->ctrl, CLOCKS_CLK_GPOUT0_CTRL_ENABLE_BITS);
91
92     // Now that the source is configured, we can trust that the user-supplied
93     // divisor is a safe value.
94     clock_hw->div = div;
95     configured_freq[clock] = actual_freq;
96 }
97
98 bool clock_configure(clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32_t src_freq,
99     uint32_t freq) {
100     assert(src_freq >= freq);
101
102     if (freq > src_freq)
103         return false;
104
105     uint64_t div64 = (((uint64_t) src_freq) << CLOCKS_CLK_GPOUT0_DIV_INT_LSB) / freq;
106     uint32_t div, actual_freq;
107     if (div64 >> 32) {
108         // set div to 0 for maximum clock divider
109         div = 0;
110         actual_freq = src_freq >> (32 - CLOCKS_CLK_GPOUT0_DIV_INT_LSB);
111     } else {
112         div = (uint32_t) div64;
113         // on RP2040 only clock divider of 1, or >= 2 are supported
114         if (div < (2u << CLOCKS_CLK_GPOUT0_DIV_INT_LSB)) {
115             div = (1u << CLOCKS_CLK_GPOUT0_DIV_INT_LSB);
116         }
117         actual_freq = (uint32_t) (((uint64_t) src_freq) << CLOCKS_CLK_GPOUT0_DIV_INT_LSB) /
        div);
117     }
118
119     clock_configure_internal(clock, src, auxsrc, actual_freq, div);
120     // Store the configured frequency
121     return true;
122 }
123
124 void clock_configure_int_divider(clock_handle_t clock, uint32_t src, uint32_t auxsrc,
uint32_t src_freq, uint32_t int_divider) {
125     clock_configure_internal(clock, src, auxsrc, src_freq / int_divider, int_divider <<
CLOCKS_CLK_GPOUT0_DIV_INT_LSB);
126 }
127
128 void clock_configure_undivided(clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32_t
src_freq) {
129     clock_configure_internal(clock, src, auxsrc, src_freq, 1u <<
CLOCKS_CLK_GPOUT0_DIV_INT_LSB);
130 }

It is called in clocks_init for each clock. The following example shows the clk_sys configuration:

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_runtime_init/runtime_init_clocks.c Lines 100 - 104

100     // CLK SYS = PLL SYS (usually) 125MHz / 1 = 125MHz
101     clock_configure_undivided(clk_sys,
102                             CLOCKS_CLK_SYS_CTRL_SRC_VALUE_CLKSRC_CLK_SYS_AUX,
103                             CLOCKS_CLK_SYS_CTRL_AUXSRC_VALUE_CLKSRC_PLL_SYS,
104                             SYS_CLK_HZ);

Once a clock is configured, clock_get_hz can be called to get the output frequency in Hz.

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_clocks/clocks.c Lines 137 - 139

137 uint32_t clock_get_hz(clock_handle_t clock) {
138     return configured_freq[clock];
139 }

⚠ WARNING

It is assumed the source frequency the programmer provides is correct. If it is not then the frequency returned by clock_get_hz will be inaccurate.

2.15.6.2. Using the frequency counter

To use the frequency counter, the programmer must:

The SDK defines a frequency_count function which takes the source as an argument and returns the frequency in kHz:

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_clocks/clocks.c Lines 147 - 174

147 uint32_t frequency_count_khz(uint src) {
148     fc_hw_t *fc = &clocks_hw->fc0;
149
150     // If frequency counter is running need to wait for it. It runs even if the source is NULL
151     while(fc->status & CLOCKS_FC0_STATUS_RUNNING_BITS) {
152         tight_loop_contents();
153     }
154
155     // Set reference freq
156     fc->ref_khz = clock_get_hz(clk_ref) / 1000;
157
158     // FIXME: Don't pick random interval. Use best interval
159     fc->interval = 10;
160
161     // No min or max
162     fc->min_khz = 0;
163     fc->max_khz = 0xffffffff;
164
165     // Set SRC which automatically starts the measurement
166     fc->src = src;
167
168     while(!(fc->status & CLOCKS_FC0_STATUS_DONE_BITS)) {
169         tight_loop_contents();
170     }
171
172     // Return the result
173     return fc->result >> CLOCKS_FC0_RESULT_KHZ_LSB;
174 }

There is also a wrapper function to change the unit to MHz:

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_clocks/include/hardware/clocks.h Lines 377 - 379

377 static inline float frequency_count_mhz(uint src) {
378     return ((float) (frequency_count_khz(src))) / KHZ;
379 }

i NOTE

The frequency counter can also be used in a test mode. This allows the hardware to check if the frequency is within a minimum frequency and a maximum frequency, set in FC0_MIN_KHZ and FC0_MAX_KHZ . In this mode, the PASS bit in FC0_STATUS will be set when DONE is set if the frequency is within the specified range. Otherwise, either the FAST or SLOW bit will be set.

If the programmer attempts to count a stopped clock, or the clock stops running then the DIED bit will be set. If any of DIED , FAST , or SLOW are set then FAIL will be set.

2.15.6.3. Configuring a GPIO output clock

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_clocks/clocks.c Lines 245 - 276

245 void clock_gpio_init_int_frac16(uint gpio, uint src, uint32_t div_int, uint16_t div_frac16)
246 {
247     // Bit messy but it's as much code to loop through a lookup
248     // table. The sources for each gpout generators are the same
248 // so just call with the sources from GP0
249 uint gpclk = 0;
250 if (gpio == 21) gpclk = clk_gpout0;
251 else if (gpio == 23) gpclk = clk_gpout1;
252 else if (gpio == 24) gpclk = clk_gpout2;
253 else if (gpio == 25) gpclk = clk_gpout3;
254 else {
255     invalid_params_if(HARDWARE_CLOCKS, true);
256 }
257
258 invalid_params_if(HARDWARE_CLOCKS, div_int >> REG_FIELD_WIDTH(
    CLOCKS_CLK_GPOUT0_DIV_INT));
259 // Set up the gpclk generator
260 clocks_hw->clk[gpclk].ctrl = (src << CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_LSB) |
261     CLOCKS_CLK_GPOUT0_CTRL_ENABLE_BITS;
262 #ifdef REG_FIELD_WIDTH(CLOCKS_CLK_GPOUT0_DIV_FRAC) == 16
263     clocks_hw->clk[gpclk].div = (div_int << CLOCKS_CLK_GPOUT0_DIV_INT_LSB) | (div_frac16 <<
        CLOCKS_CLK_GPOUT0_DIV_FRAC_LSB);
264 #elif REG_FIELD_WIDTH(CLOCKS_CLK_GPOUT0_DIV_FRAC) == 8
265     clocks_hw->clk[gpclk].div = (div_int << CLOCKS_CLK_GPOUT0_DIV_INT_LSB) | ((div_frac16
        >> 8u) << CLOCKS_CLK_GPOUT0_DIV_FRAC_LSB);
266 #else
267 #error unsupported number of fractional bits
268 #endif
269
270 // Set gpio pin to gpclock function
271 gpio_set_function(gpio, GPIO_FUNC_GPCK);
272 }

2.15.6.4. Configuring a GPIO input clock

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2-common/hardware_clocks/clocks.c Lines 313 - 343

313 bool clock_configure_gpin(clock_handle_t clock, uint gpio, uint32_t src_freq, uint32_t freq)
314 {
315     // Configure a clock to run from a GPIO input
316     uint gpin = 0;
317     if (gpio == 20) gpin = 0;
318     else if (gpio == 22) gpin = 1;
319     else {
320         invalid_params_if(HARDWARE_CLOCKS, true);
321     }
322
323     // Work out sources. GPIN is always an auxsrc
324     uint src = 0;
325
326     // GPIN1 == GPIN0 + 1
327     uint auxsrc = gpin0_src[clock] + gpin;
328
329     if (has_glitchless_mux(clock)) {
330         // AUX src is always 1
331         src = 1;
332     }
333
334     // Set the GPIO function
335     gpio_set_function(gpio, GPIO_FUNC_GPCK);
336
337     // Now we have the src, auxsrc, and configured the gpio input
338     // call clock configure to run the clock from a gpio
339     return clock_configure(clock, src, auxsrc, src_freq, freq);
339 }

2.15.6.5. Enabling resus

SDK: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_clocks/clocks.c Lines 221 - 243

221 void clocks_enable_resus(resus_callback_t resus_callback) {
222     // Restart clk_sys if it is stopped by forcing it
223     // to the default source of clk_ref. If clk_ref stops running this will
224     // not work.
225
226     // Store user's resus callback
227     _resus_callback = resus_callback;
228
229     irq_set_exclusive_handler(CLOCKS_IRQ, clocks_irq_handler);
230
231     // Enable the resus interrupt in clocks
232     clocks_hw->inte = CLOCKS_INTE_CLK_SYS_RESUS_BITS;
233
234     // Enable the clocks irq
235     irq_set_enabled(CLOCKS_IRQ, true);
236
237     // 2 * clk_ref freq / clk_sys_min_freq;
238     // assume clk_ref is 3MHz and we want clk_sys to be no lower than 1MHz
239     uint timeout = 2 * 3 * 1;
240
241     // Enable resus with the maximum timeout
242     clocks_hw->resus.ctrl = CLOCKS_CLK_SYS_RESUS_CTRL_ENABLE_BITS | timeout;
243 }

2.15.6.6. Configuring sleep mode

Sleep mode is active when neither processor core or the DMA are requesting clocks. For example, the DMA is not active and both core0 and core1 are waiting for an interrupt. The SLEEP_EN registers set what clocks are running in sleep mode. The hello_sleep example ( https://github.com/raspberrypi/pico-playground/blob/master/sleep/hello_sleep/hello_sleep_aon.c ) illustrates how to put the chip to sleep until the RTC fires. In this case, only the RTC clock is enabled in the SLEEP_EN0 register.

i NOTE

clk_sys is always sent to proc0 and proc1 during sleep mode as some logic needs to be clocked for the processor to wake up again.

Pico Extras: https://github.com/raspberrypi/pico-extras/blob/master/src/rp2_common/pico_sleep/sleep.c Lines 159 - 183

159 void sleep_goto_sleep_until(struct timespec *ts, aon_timer_alarm_handler_t callback)
160 {
161
162     // We should have already called the sleep_run_from_dormant_source function
163     // This is only needed for dormancy although it saves power running from xosc while
164     // sleeping
165     //assert(dormant_source_valid(_dormant_source));
166
167     clocks_hw->sleep_en0 = CLOCKS_SLEEP_EN0_CLK_RTC_RTC_BITS;
168     clocks_hw->sleep_en1 = 0x0;
168
169     aon_timer_enable_alarm(ts, callback, false);
170
171     stdio_flush();
172
173     // Enable deep sleep at the proc
174     processor_deep_sleep();
175
176     // Go to sleep
177     __wfi();
178 }

2.15.7. List of Registers

The Clocks registers start at a base address of 0x40008000(defined as CLOCKS_BASE in SDK).

Table 207. List of CLOCKS registers

OffsetNameInfo
0x00CLK_GPOUT0_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x04CLK_GPOUT0_DIVClock divisor, can be changed on-the-fly
0x08CLK_GPOUT0_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x0cCLK_GPOUT1_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x10CLK_GPOUT1_DIVClock divisor, can be changed on-the-fly
0x14CLK_GPOUT1_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x18CLK_GPOUT2_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x1cCLK_GPOUT2_DIVClock divisor, can be changed on-the-fly
0x20CLK_GPOUT2_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x24CLK_GPOUT3_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x28CLK_GPOUT3_DIVClock divisor, can be changed on-the-fly
0x2cCLK_GPOUT3_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x30CLK_REF_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x34CLK_REF_DIVClock divisor, can be changed on-the-fly
0x38CLK_REF_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x3cCLK_SYS_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x40CLK_SYS_DIVClock divisor, can be changed on-the-fly
0x44CLK_SYS_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x48CLK_PERI_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x50CLK_PERI_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
OffsetNameInfo
0x54CLK_USB_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x58CLK_USB_DIVClock divisor, can be changed on-the-fly
0x5cCLK_USB_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x60CLK_ADC_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x64CLK_ADC_DIVClock divisor, can be changed on-the-fly
0x68CLK_ADC_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x6cCLK_RTC_CTRLClock control, can be changed on-the-fly (except for auxsrc)
0x70CLK_RTC_DIVClock divisor, can be changed on-the-fly
0x74CLK_RTC_SELECTEDIndicates which SRC is currently selected by the glitchless mux (one-hot).
0x78CLK_SYS_RESUS_CTRL
0x7cCLK_SYS_RESUS_STATUS
0x80FC0_REF_KHZReference clock frequency in kHz
0x84FC0_MIN_KHZMinimum pass frequency in kHz. This is optional. Set to 0 if you are not using the pass/fail flags
0x88FC0_MAX_KHZMaximum pass frequency in kHz. This is optional. Set to 0x1fffff if you are not using the pass/fail flags
0x8cFC0_DELAYDelays the start of frequency counting to allow the mux to settle
Delay is measured in multiples of the reference clock period
0x90FC0_INTERVALThe test interval is \( 0.98\mu s * 2^{**}interval \) , but let's call it \( 1\mu s * 2^{**}interval \)
The default gives a test interval of 250us
0x94FC0_SRCClock sent to frequency counter, set to 0 when not required
Writing to this register initiates the frequency count
0x98FC0_STATUSFrequency counter status
0x9cFC0_RESULTResult of frequency measurement, only valid when status_done=1
0xa0WAKE_EN0enable clock in wake mode
0xa4WAKE_EN1enable clock in wake mode
0xa8SLEEP_EN0enable clock in sleep mode
0xacSLEEP_EN1enable clock in sleep mode
0xb0ENABLED0indicates the state of the clock enable
0xb4ENABLED1indicates the state of the clock enable
0xb8INTRRaw Interrupts
0xbcINTEInterrupt Enable
0xc0INTFInterrupt Force
0xc4INTSInterrupt status after masking & forcing
CLOCKS: CLK_GPOUT0_CTRL Register Offset: 0x00 Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 208.
CLK_GPOUT0_CTRL
Register
BitsDescriptionTypeReset
31:21Reserved.--
20NUDGE: An edge on this signal shifts the phase of the output by 1 cycle of the input clock
This can be done at any time
RW0x0
19:18Reserved.--
17:16PHASE: This delays the enable signal by up to 3 cycles of the input clock
This must be set before the clock is enabled to have any effect
RW0x0
15:13Reserved.--
12DC50: Enables duty cycle correction for odd divisorsRW0x0
11ENABLE: Starts and stops the clock generator cleanlyRW0x0
10KILL: Asynchronously kills the clock generatorRW0x0
9Reserved.--
8:5AUXSRC: Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_SYS
0x1 → CLKSRC_GPIN0
0x2 → CLKSRC_GPIN1
0x3 → CLKSRC_PLL_USB
0x4 → ROSC_CLKSRC
0x5 → XOSC_CLKSRC
0x6 → CLK_SYS
0x7 → CLK_USB
0x8 → CLK_ADC
0x9 → CLK_RTC
0xa → CLK_REF
4:0Reserved.--
CLOCKS: CLK_GPOUT0_DIV Register Offset: 0x04 Description

Clock divisor, can be changed on-the-fly

Table 209.
CLK_GPOUT0_DIV
Register

BitsDescriptionTypeReset
31:8INT : Integer component of the divisor, 0 → divide by 2 16RW0x000001
7:0FRAC : Fractional component of the divisorRW0x00

CLOCKS: CLK_GPOUT0_SELECTED Register

Offset: 0x08

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 210.
CLK_GPOUT0_SELECT
ED Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001

CLOCKS: CLK_GPOUT1_CTRL Register

Offset: 0x0c

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 211.
CLK_GPOUT1_CTRL
Register

BitsDescriptionTypeReset
31:21Reserved.--
20NUDGE : An edge on this signal shifts the phase of the output by 1 cycle of the input clock
This can be done at any time
RW0x0
19:18Reserved.--
17:16PHASE : This delays the enable signal by up to 3 cycles of the input clock
This must be set before the clock is enabled to have any effect
RW0x0
15:13Reserved.--
12DC50 : Enables duty cycle correction for odd divisorsRW0x0
11ENABLE : Starts and stops the clock generator cleanlyRW0x0
10KILL : Asynchronously kills the clock generatorRW0x0
9Reserved.--
8:5AUXSRC : Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_SYS
0x1 → CLKSRC_GPIN0
0x2 → CLKSRC_GPIN1
0x3 → CLKSRC_PLL_USB
0x4 → ROSC_CLKSRC
0x5 → XOSC_CLKSRC
0x6 → CLK_SYS
0x7 → CLK_USB
BitsDescriptionTypeReset
0x8 → CLK_ADC
0x9 → CLK_RTC
0xa → CLK_REF
4:0Reserved.--

CLOCKS: CLK_GPOUT1_DIV Register

Offset: 0x10

Description

Clock divisor, can be changed on-the-fly

Table 212.
CLK_GPOUT1_DIV
Register

BitsDescriptionTypeReset
31:8INT : Integer component of the divisor, 0 → divide by 2 16RW0x000001
7:0FRAC : Fractional component of the divisorRW0x00

CLOCKS: CLK_GPOUT1_SELECTED Register

Offset: 0x14

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 213.
CLK_GPOUT1_SELECTED
Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001

CLOCKS: CLK_GPOUT2_CTRL Register

Offset: 0x18

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 214.
CLK_GPOUT2_CTRL
Register

BitsDescriptionTypeReset
31:21Reserved.--
20NUDGE : An edge on this signal shifts the phase of the output by 1 cycle of the input clock
This can be done at any time
RW0x0
19:18Reserved.--
17:16PHASE : This delays the enable signal by up to 3 cycles of the input clock
This must be set before the clock is enabled to have any effect
RW0x0
15:13Reserved.--
12DC50 : Enables duty cycle correction for odd divisorsRW0x0
11ENABLE : Starts and stops the clock generator cleanlyRW0x0
10KILL : Asynchronously kills the clock generatorRW0x0
9Reserved.--
BitsDescriptionTypeReset
8:5AUXSRC : Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_SYS
0x1 → CLKSRC_GPIN0
0x2 → CLKSRC_GPIN1
0x3 → CLKSRC_PLL_USB
0x4 → ROSC_CLKSRC_PH
0x5 → XOSC_CLKSRC
0x6 → CLK_SYS
0x7 → CLK_USB
0x8 → CLK_ADC
0x9 → CLK_RTC
0xa → CLK_REF
4:0Reserved.--

CLOCKS: CLK_GPOUT2_DIV Register

Offset: 0x1c

Description

Clock divisor, can be changed on-the-fly

Table 215.
CLK_GPOUT2_DIV
Register

BitsDescriptionTypeReset
31:8INT : Integer component of the divisor, 0 → divide by 2 16RW0x000001
7:0FRAC : Fractional component of the divisorRW0x00

CLOCKS: CLK_GPOUT2_SELECTED Register

Offset: 0x20

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 216.
CLK_GPOUT2_SELECTED
Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001

CLOCKS: CLK_GPOUT3_CTRL Register

Offset: 0x24

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 217.
CLK_GPOUT3_CTRL
Register

BitsDescriptionTypeReset
31:21Reserved.--
BitsDescriptionTypeReset
20NUDGE : An edge on this signal shifts the phase of the output by 1 cycle of the input clock
This can be done at any time
RW0x0
19:18Reserved.--
17:16PHASE : This delays the enable signal by up to 3 cycles of the input clock
This must be set before the clock is enabled to have any effect
RW0x0
15:13Reserved.--
12DC50 : Enables duty cycle correction for odd divisorsRW0x0
11ENABLE : Starts and stops the clock generator cleanlyRW0x0
10KILL : Asynchronously kills the clock generatorRW0x0
9Reserved.--
8:5AUXSRC : Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_SYS
0x1 → CLKSRC_GPIN0
0x2 → CLKSRC_GPIN1
0x3 → CLKSRC_PLL_USB
0x4 → ROSC_CLKSRC_PH
0x5 → XOSC_CLKSRC
0x6 → CLK_SYS
0x7 → CLK_USB
0x8 → CLK_ADC
0x9 → CLK_RTC
0xa → CLK_REF
4:0Reserved.--

CLOCKS: CLK_GPOUT3_DIV Register

Offset: 0x28

Description

Clock divisor, can be changed on-the-fly

Table 218.
CLK_GPOUT3_DIV
Register

BitsDescriptionTypeReset
31:8INT : Integer component of the divisor, 0 → divide by 2 16RW0x000001
7:0FRAC : Fractional component of the divisorRW0x00

CLOCKS: CLK_GPOUT3_SELECTED Register

Offset: 0x2c

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 219.
CLK_GPOUT3_SELECT
ED Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001
CLOCKS: CLK_REF_CTRL Register

Offset: 0x30

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 220.
CLK_REF_CTRL
Register

BitsDescriptionTypeReset
31:7Reserved.--
6:5AUXSRC: Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_USB
0x1 → CLKSRC_GPIN0
0x2 → CLKSRC_GPIN1
4:2Reserved.--
1:0SRC: Selects the clock source glitchlessly, can be changed on-the-flyRW-
Enumerated values:
0x0 → ROSC_CLKSRC_PH
0x1 → CLKSRC_CLK_REF_AUX
0x2 → XOSC_CLKSRC
CLOCKS: CLK_REF_DIV Register

Offset: 0x34

Description

Clock divisor, can be changed on-the-fly

Table 221.
CLK_REF_DIV Register

BitsDescriptionTypeReset
31:10Reserved.--
9:8INT: Integer component of the divisor, 0 → divide by 2 16RW0x1
7:0Reserved.--
CLOCKS: CLK_REF_SELECTED Register

Offset: 0x38

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 222.
CLK_REF_SELECTED
Register

BitsDescriptionTypeReset
31:0The glitchless multiplexer does not switch instantaneously (to avoid glitches), so software should poll this register to wait for the switch to complete. This register contains one decoded bit for each of the clock sources enumerated in the CTRL SRC field. At most one of these bits will be set at any time, indicating that clock is currently present at the output of the glitchless mux. Whilst switching is in progress, this register may briefly show all-0s.RO0x00000001

CLOCKS: CLK_SYS_CTRL Register

Offset: 0x3c

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 223.
CLK_SYS_CTRL
Register

BitsDescriptionTypeReset
31:8Reserved.--
7:5AUXSRC: Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_SYS
0x1 → CLKSRC_PLL_USB
0x2 → ROSC_CLKSRC
0x3 → XOSC_CLKSRC
0x4 → CLKSRC_GPIN0
0x5 → CLKSRC_GPIN1
4:1Reserved.--
0SRC: Selects the clock source glitchlessly, can be changed on-the-flyRW0x0
Enumerated values:
0x0 → CLK_REF
0x1 → CLKSRC_CLK_SYS_AUX

CLOCKS: CLK_SYS_DIV Register

Offset: 0x40

Description

Clock divisor, can be changed on-the-fly

Table 224.
CLK_SYS_DIV Register

BitsDescriptionTypeReset
31:8INT: Integer component of the divisor, 0 → divide by 2 16RW0x000001
7:0FRAC: Fractional component of the divisorRW0x00

CLOCKS: CLK_SYS_SELECTED Register

Offset: 0x44

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 225.
CLK_SYS_SELECTED
Register

BitsDescriptionTypeReset
31:0The glitchless multiplexer does not switch instantaneously (to avoid glitches), so software should poll this register to wait for the switch to complete. This register contains one decoded bit for each of the clock sources enumerated in the CTRL SRC field. At most one of these bits will be set at any time, indicating that clock is currently present at the output of the glitchless mux. Whilst switching is in progress, this register may briefly show all-0s.RO0x00000001

CLOCKS: CLK_PERI_CTRL Register

Offset: 0x48

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 226.
CLK_PERI_CTRL
Register

BitsDescriptionTypeReset
31:12Reserved.--
11ENABLE: Starts and stops the clock generator cleanlyRW0x0
10KILL: Asynchronously kills the clock generatorRW0x0
9:8Reserved.--
7:5AUXSRC: Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLK_SYS
0x1 → CLKSRC_PLL_SYS
0x2 → CLKSRC_PLL_USB
0x3 → ROOSC_CLKSRC_PH
0x4 → XOOSC_CLKSRC
0x5 → CLKSRC_GPIN0
0x6 → CLKSRC_GPIN1
4:0Reserved.--

CLOCKS: CLK_PERI_SELECTED Register

Offset: 0x50

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 227.
CLK_PERI_SELECTED
Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001

CLOCKS: CLK_USB_CTRL Register

Offset: 0x54

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 228.
CLK_USB_CTRL
Register

BitsDescriptionTypeReset
31:21Reserved.--
20NUDGE : An edge on this signal shifts the phase of the output by 1 cycle of the input clock
This can be done at any time
RW0x0
19:18Reserved.--
17:16PHASE : This delays the enable signal by up to 3 cycles of the input clock
This must be set before the clock is enabled to have any effect
RW0x0
15:12Reserved.--
11ENABLE : Starts and stops the clock generator cleanlyRW0x0
10KILL : Asynchronously kills the clock generatorRW0x0
9:8Reserved.--
7:5AUXSRC : Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_USB
0x1 → CLKSRC_PLL_SYS
0x2 → ROSC_CLKSRC_PH
0x3 → XOSC_CLKSRC
0x4 → CLKSRC_GPIN0
0x5 → CLKSRC_GPIN1
4:0Reserved.--

CLOCKS: CLK_USB_DIV Register

Offset: 0x58

Description

Clock divisor, can be changed on-the-fly

Table 229.
CLK_USB_DIV Register

BitsDescriptionTypeReset
31:10Reserved.--
9:8INT : Integer component of the divisor, 0 → divide by 2 16RW0x1
7:0Reserved.--

CLOCKS: CLK_USB_SELECTED Register

Offset: 0x5c

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 230.
CLK_USB_SELECTED
Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001

CLOCKS: CLK_ADC_CTRL Register

Offset: 0x60

Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 231.
CLK_ADC_CTRL
Register

BitsDescriptionTypeReset
31:21Reserved.--
20NUDGE : An edge on this signal shifts the phase of the output by 1 cycle of the input clock
This can be done at any time
RW0x0
19:18Reserved.--
17:16PHASE : This delays the enable signal by up to 3 cycles of the input clock
This must be set before the clock is enabled to have any effect
RW0x0
15:12Reserved.--
11ENABLE : Starts and stops the clock generator cleanlyRW0x0
10KILL : Asynchronously kills the clock generatorRW0x0
9:8Reserved.--
7:5AUXSRC : Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_USB
0x1 → CLKSRC_PLL_SYS
0x2 → ROSC_CLKSRC_PH
0x3 → XOSC_CLKSRC
0x4 → CLKSRC_GPIN0
0x5 → CLKSRC_GPIN1
4:0Reserved.--

CLOCKS: CLK_ADC_DIV Register

Offset: 0x64

Description

Clock divisor, can be changed on-the-fly

Table 232.
CLK_ADC_DIV Register

BitsDescriptionTypeReset
31:10Reserved.--
9:8INT : Integer component of the divisor, 0 → divide by 2 16RW0x1
7:0Reserved.--
CLOCKS: CLK_ADC_SELECTED Register Offset: 0x68 Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 233.
CLK_ADC_SELECTED
Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001
CLOCKS: CLK_RTC_CTRL Register Offset: 0x6c Description

Clock control, can be changed on-the-fly (except for auxsrc)

Table 234.
CLK_RTC_CTRL
Register

BitsDescriptionTypeReset
31:21Reserved.--
20NUDGE: An edge on this signal shifts the phase of the output by 1 cycle of the input clock
This can be done at any time
RW0x0
19:18Reserved.--
17:16PHASE: This delays the enable signal by up to 3 cycles of the input clock
This must be set before the clock is enabled to have any effect
RW0x0
15:12Reserved.--
11ENABLE: Starts and stops the clock generator cleanlyRW0x0
10KILL: Asynchronously kills the clock generatorRW0x0
9:8Reserved.--
7:5AUXSRC: Selects the auxiliary clock source, will glitch when switchingRW0x0
Enumerated values:
0x0 → CLKSRC_PLL_USB
0x1 → CLKSRC_PLL_SYS
0x2 → ROSC_CLKSRC_PH
0x3 → XOSC_CLKSRC
0x4 → CLKSRC_GPIN0
0x5 → CLKSRC_GPIN1
4:0Reserved.--
CLOCKS: CLK_RTC_DIV Register Offset: 0x70 Description

Clock divisor, can be changed on-the-fly

Table 235.
CLK_RTC_DIV Register

BitsDescriptionTypeReset
31:8INT : Integer component of the divisor, 0 → divide by 2 16RW0x000001
7:0FRAC : Fractional component of the divisorRW0x00

CLOCKS: CLK_RTC_SELECTED Register

Offset: 0x74

Description

Indicates which SRC is currently selected by the glitchless mux (one-hot).

Table 236.
CLK_RTC_SELECTED Register

BitsDescriptionTypeReset
31:0This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.RO0x00000001

CLOCKS: CLK_SYS_RESUS_CTRL Register

Offset: 0x78

Table 237.
CLK_SYS_RESUS_CTRL Register

BitsDescriptionTypeReset
31:17Reserved.--
16CLEAR : For clearing the resus after the fault that triggered it has been correctedRW0x0
15:13Reserved.--
12FRCE : Force a resus, for test purposes onlyRW0x0
11:9Reserved.--
8ENABLE : Enable resusRW0x0
7:0TIMEOUT : This is expressed as a number of clk_ref cycles and must be >= 2x clk_ref_freq/min_clk_tst_freqRW0xff

CLOCKS: CLK_SYS_RESUS_STATUS Register

Offset: 0x7c

Table 238.
CLK_SYS_RESUS_STATUS Register

BitsDescriptionTypeReset
31:1Reserved.--
0RESUSSED : Clock has been resuscitated, correct the error then send ctrl_clear=1RO0x0

CLOCKS: FC0_REF_KHZ Register

Offset: 0x80

Table 239.
FC0_REF_KHZ Register

BitsDescriptionTypeReset
31:20Reserved.--
19:0Reference clock frequency in kHzRW0x00000

CLOCKS: FC0_MIN_KHZ Register

Offset: 0x84

Table 240.
FC0_MIN_KHZ
Register

BitsDescriptionTypeReset
31:25Reserved.--
24:0Minimum pass frequency in kHz. This is optional. Set to 0 if you are not using the pass/fail flagsRW0x0000000

CLOCKS: FC0_MAX_KHZ Register

Offset: 0x88

Table 241.
FC0_MAX_KHZ
Register

BitsDescriptionTypeReset
31:25Reserved.--
24:0Maximum pass frequency in kHz. This is optional. Set to 0x1ffffff if you are not using the pass/fail flagsRW0x1ffffff

CLOCKS: FC0_DELAY Register

Offset: 0x8c

Table 242. FC0_DELAY
Register

BitsDescriptionTypeReset
31:3Reserved.--
2:0Delays the start of frequency counting to allow the mux to settle
Delay is measured in multiples of the reference clock period
RW0x1

CLOCKS: FC0_INTERVAL Register

Offset: 0x90

Table 243.
FC0_INTERVAL
Register

BitsDescriptionTypeReset
31:4Reserved.--
3:0The test interval is \( 0.98\mu s * 2^{**interval} \) , but let's call it \( 1\mu s * 2^{**interval} \)
The default gives a test interval of 250us
RW0x8

CLOCKS: FC0_SRC Register

Offset: 0x94

Table 244. FC0_SRC
Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0Clock sent to frequency counter, set to 0 when not required
Writing to this register initiates the frequency count
RW0x00
Enumerated values:
0x00 → NULL
BitsDescriptionTypeReset
0x01 → PLL_SYS_CLKSRC_PRIMARY
0x02 → PLL_USB_CLKSRC_PRIMARY
0x03 → ROSC_CLKSRC
0x04 → ROSC_CLKSRC_PH
0x05 → XOSC_CLKSRC
0x06 → CLKSRC_GPIN0
0x07 → CLKSRC_GPIN1
0x08 → CLK_REF
0x09 → CLK_SYS
0x0a → CLK_PERI
0x0b → CLK_USB
0x0c → CLK_ADC
0x0d → CLK_RTC

CLOCKS: FC0_STATUS Register

Offset: 0x98

Description

Frequency counter status

Table 245.
FC0_STATUS Register

BitsDescriptionTypeReset
31:29Reserved.--
28DIED: Test clock stopped during testRO0x0
27:25Reserved.--
24FAST: Test clock faster than expected, only valid when status_done=1RO0x0
23:21Reserved.--
20SLOW: Test clock slower than expected, only valid when status_done=1RO0x0
19:17Reserved.--
16FAIL: Test failedRO0x0
15:13Reserved.--
12WAITING: Waiting for test clock to startRO0x0
11:9Reserved.--
8RUNNING: Test runningRO0x0
7:5Reserved.--
4DONE: Test completeRO0x0
3:1Reserved.--
0PASS: Test passedRO0x0

CLOCKS: FC0_RESULT Register

Offset: 0x9c Description

Result of frequency measurement, only valid when status_done=1

Table 246.
FC0_RESULT Register
Offset 0x0 0x4 0x8 0xc BitsName FRCE_ON FRCE_OFF WDSEL DONE DescriptionInfo Force block out of reset (i.e. power it on) Force into reset (i.e. power it off) Set to 1 if this peripheral should be reset when the watchdog Indicates the peripheral’s registers are ready to access. TypeReset
31:30Reserved.--
29:5KHZRO0x0000000
4:0FRACRO0x00
Bitsenable clock in wake mode DescriptionTypeReset
31CLK_SYS_SRAM3RW0x1
30CLK_SYS_SRAM2RW0x1
29CLK_SYS_SRAM1RW0x1
28CLK_SYS_SRAM0RW0x1
27CLK_SYS_SPI1RW0x1
26CLK_PERI_SPI1RW0x1
25CLK_SYS_SPI0RW0x1
24CLK_PERI_SPI0RW0x1
23CLK_SYS_SIORW0x1
22CLK_SYS_RTCRW0x1
21CLK_RTC_RTCRW0x1
20CLK_SYS_ROSCRW0x1
19CLK_SYS_ROMRW0x1
18CLK_SYS_RESETSRW0x1
17CLK_SYS_PWMRW0x1
16CLK_SYS_PSMRW0x1
15CLK_SYS_PLL_USBRW0x1
14CLK_SYS_PLL_SYSRW0x1
13CLK_SYS_PIO1RW0x1
12CLK_SYS_PIO0RW0x1
11CLK_SYS_PADSRW0x1
10CLK_SYS_VREG_AND_CHIP_RESETRW0x1
9CLK_SYS_JTAGRW0x1
8CLK_SYS_IORW0x1
CLOCKS: WAKE_EN0 Register Offset: 0xa0 Description

enable clock in wake mode

Table 247. WAKE_EN0
Register
BitsDescriptionTypeReset
7CLK_SYS_I2C1RW0x1
6CLK_SYS_I2C0RW0x1
5CLK_SYS_DMARW0x1
4CLK_SYS_BUSFABRICRW0x1
3CLK_SYS_BUSCTRLRW0x1
2CLK_SYS_ADCRW0x1
1CLK_ADC_ADCRW0x1
0CLK_SYS_CLOCKSRW0x1

CLOCKS: WAKE_EN1 Register

Offset: 0xa4

Description

enable clock in wake mode

Table 248. WAKE_EN1 Register

BitsDescriptionTypeReset
31:15Reserved.--
14CLK_SYS_XOSCRW0x1
13CLK_SYS_XIPRW0x1
12CLK_SYS_WATCHDOGRW0x1
11CLK_USB_USBCTRLRW0x1
10CLK_SYS_USBCTRLRW0x1
9CLK_SYS_UART1RW0x1
8CLK_PERI_UART1RW0x1
7CLK_SYS_UART0RW0x1
6CLK_PERI_UART0RW0x1
5CLK_SYS_TIMERRW0x1
4CLK_SYS_TBMANRW0x1
3CLK_SYS_SYSINFORW0x1
2CLK_SYS_SYSCFGRW0x1
1CLK_SYS_SRAM5RW0x1
0CLK_SYS_SRAM4RW0x1

CLOCKS: SLEEP_EN0 Register

Offset: 0xa8

Description

enable clock in sleep mode

Table 249. SLEEP_EN0 Register

BitsDescriptionTypeReset
31CLK_SYS_SRAM3RW0x1
BitsDescriptionTypeReset
30CLK_SYS_SRAM2RW0x1
29CLK_SYS_SRAM1RW0x1
28CLK_SYS_SRAM0RW0x1
27CLK_SYS_SPI1RW0x1
26CLK_PERI_SPI1RW0x1
25CLK_SYS_SPI0RW0x1
24CLK_PERI_SPI0RW0x1
23CLK_SYS_SIORW0x1
22CLK_SYS_RTCRW0x1
21CLK_RTC_RTCRW0x1
20CLK_SYS_ROSCRW0x1
19CLK_SYS_ROMRW0x1
18CLK_SYS_RESETSRW0x1
17CLK_SYS_PWMRW0x1
16CLK_SYS_PSMRW0x1
15CLK_SYS_PLL_USBRW0x1
14CLK_SYS_PLL_SYSRW0x1
13CLK_SYS_PIO1RW0x1
12CLK_SYS_PIO0RW0x1
11CLK_SYS_PADSRW0x1
10CLK_SYS_VREG_AND_CHIP_RESETRW0x1
9CLK_SYS_JTAGRW0x1
8CLK_SYS_IORW0x1
7CLK_SYS_I2C1RW0x1
6CLK_SYS_I2C0RW0x1
5CLK_SYS_DMARW0x1
4CLK_SYS_BUSFABRICRW0x1
3CLK_SYS_BUSCTRLRW0x1
2CLK_SYS_ADCRW0x1
1CLK_ADC_ADCRW0x1
0CLK_SYS_CLOCKSRW0x1

CLOCKS: SLEEP_EN1 Register

Offset: 0xac

Description

enable clock in sleep mode

Table 250. SLEEP_EN1 Register

BitsDescriptionTypeReset
31:15Reserved.--
14CLK_SYS_XOSCRW0x1
13CLK_SYS_XIPRW0x1
12CLK_SYS_WATCHDOGRW0x1
11CLK_USB_USBCTRLRW0x1
10CLK_SYS_USBCTRLRW0x1
9CLK_SYS_UART1RW0x1
8CLK_PERI_UART1RW0x1
7CLK_SYS_UART0RW0x1
6CLK_PERI_UART0RW0x1
5CLK_SYS_TIMERRW0x1
4CLK_SYS_TBMANRW0x1
3CLK_SYS_SYSINFORW0x1
2CLK_SYS_SYSCFGRW0x1
1CLK_SYS_SRAM5RW0x1
0CLK_SYS_SRAM4RW0x1

CLOCKS: ENABLED0 Register

Offset: 0xb0

Description

indicates the state of the clock enable

Table 251. ENABLED0 Register

BitsDescriptionTypeReset
31CLK_SYS_SRAM3RO0x0
30CLK_SYS_SRAM2RO0x0
29CLK_SYS_SRAM1RO0x0
28CLK_SYS_SRAM0RO0x0
27CLK_SYS_SPI1RO0x0
26CLK_PERI_SPI1RO0x0
25CLK_SYS_SPI0RO0x0
24CLK_PERI_SPI0RO0x0
23CLK_SYS_SIORO0x0
22CLK_SYS_RTCRO0x0
21CLK_RTC_RTCRO0x0
20CLK_SYS_ROSCRO0x0
19CLK_SYS_ROMRO0x0
18CLK_SYS_RESETSRO0x0
BitsDescriptionTypeReset
17CLK_SYS_PWMRO0x0
16CLK_SYS_PSMRO0x0
15CLK_SYS_PLL_USBRO0x0
14CLK_SYS_PLL_SYSRO0x0
13CLK_SYS_PIO1RO0x0
12CLK_SYS_PIO0RO0x0
11CLK_SYS_PADSRO0x0
10CLK_SYS_VREG_AND_CHIP_RESETRO0x0
9CLK_SYS_JTAGRO0x0
8CLK_SYS_IORO0x0
7CLK_SYS_I2C1RO0x0
6CLK_SYS_I2C0RO0x0
5CLK_SYS_DMARO0x0
4CLK_SYS_BUSFABRICRO0x0
3CLK_SYS_BUSCTRLRO0x0
2CLK_SYS_ADCRO0x0
1CLK_ADC_ADCRO0x0
0CLK_SYS_CLOCKSRO0x0

CLOCKS: ENABLED1 Register

Offset: 0xb4

Description

indicates the state of the clock enable

Table 252. ENABLED1 Register

BitsDescriptionTypeReset
31:15Reserved.--
14CLK_SYS_XOSCRO0x0
13CLK_SYS_XIPRO0x0
12CLK_SYS_WATCHDOGRO0x0
11CLK_USB_USBCTRLRO0x0
10CLK_SYS_USBCTRLRO0x0
9CLK_SYS_UART1RO0x0
8CLK_PERI_UART1RO0x0
7CLK_SYS_UART0RO0x0
6CLK_PERI_UART0RO0x0
5CLK_SYS_TIMERRO0x0
4CLK_SYS_TBMANRO0x0
BitsDescriptionTypeReset
3CLK_SYS_SYSINFORO0x0
2CLK_SYS_SYSCFGRO0x0
1CLK_SYS_SRAM5RO0x0
0CLK_SYS_SRAM4RO0x0

CLOCKS: INTR Register

Offset: 0xb8

Description

Raw Interrupts

Table 253. INTR Register

BitsDescriptionTypeReset
31:1Reserved.--
0CLK_SYS_RESUSRO0x0

CLOCKS: INTE Register

Offset: 0xbc

Description

Interrupt Enable

Table 254. INTE Register

BitsDescriptionTypeReset
31:1Reserved.--
0CLK_SYS_RESUSRW0x0

CLOCKS: INTF Register

Offset: 0xc0

Description

Interrupt Force

Table 255. INTF Register

BitsDescriptionTypeReset
31:1Reserved.--
0CLK_SYS_RESUSRW0x0

CLOCKS: INTS Register

Offset: 0xc4

Description

Interrupt status after masking & forcing

Table 256. INTS Register

BitsDescriptionTypeReset
31:1Reserved.--
0CLK_SYS_RESUSRO0x0