Datasheet

Table Of Contents
IRQ_SETUP_0.MATCH_ACTIVE = 1
NOTE
The enable matching step can be done during the write to IRQ_SETUP_0, as long as it happens after the write to
IRQ_SETUP_1
4.9.4.5. Recurring alarm
TO DO: LIAM/ANDRAS: sample code? The interrupt setup registers are used to set a specific date and time for an interrupt
to happen.
To set up a recurring alarm for every Monday at 11:00am:
Turn off global matching. IRQ_SETUP_0
Disable matching with an atomic write: IRQ_SETUP_0.MATCH_ENA = 0
and wait until the status confirms that the matching became inactive
IRQ_SETUP_0.MATCH_ACTIVE = 0
Now it is safe to program the registers:
IRQ_SETUP_1.DOTW_ENA = 1
IRQ_SETUP_1.HOUR_ENA = 1
IRQ_SETUP_1.MIN_ENA = 1
IRQ_SETUP_1.DOTW = 1
IRQ_SETUP_1.HOUR = 11
IRQ_SETUP_1.MIN = 0
Now, enable matching with an atomic write
IRQ_SETUP_0.MATCH_ENA = 1
and wait until the status confirms that the matching became active
IRQ_SETUP_0.MATCH_ACTIVE = 1
4.9.4.6. Interaction with Dormant / Sleep mode
RP2040 supports two power saving levels:
Sleep mode, where the processors are asleep and the unused clocks in the chip are stopped (see Section 2.14.3.4)
Dormant mode, where all clocks in the chip are stopped
The RTC can wake the chip up from both of these modes. In sleep mode, RP2040 can be configured such that only
clk_rtc (a slow RTC reference clock) is running, as well as a small amount of logic that allows the processor to wake back
up. The processor is woken from sleep mode when the RTC alarm interrupt fires. See Section 2.10.5.1 for more
information.
To wake the chip from dormant mode, the RTC must be configured to use an external reference clock (supplied by a GPIO
pin) TO DO: LIAM/ANDRAS: sample code? * Set up the RTC to run on an external reference * If the processor is running off
the PLL, change it to run from XOSC/ROSC * Turn off the PLLs * Set up the RTC with the desired wake up time (one off, or
recurring) * (optionally) power down most memories * Invoke DORMANT mode (see Crystal Oscillator, Ring Oscillator, and
Section 2.10.5.2 for more information)
4.9.5. Programmer’s Model
RP2040 Datasheet
4.9. RTC 575