enabled by setting the corresponding bit in the Interrupt Enable Set register (INTENSET=1), and disabled
by setting the corresponding bit in the Interrupt Enable Clear register (INTENCLR=1).
An interrupt request is generated when the interrupt flag is raised and the corresponding interrupt is
enabled. The interrupt request remains active until either the interrupt flag is cleared, the interrupt is
disabled or the RTC is reset. See the description of the INTFLAG registers for details on how to clear
interrupt flags.
All interrupt requests from the peripheral are ORed together on system level to generate one combined
interrupt request to the NVIC. Refer to the Nested Vector Interrupt Controller for details. The user must
read the INTFLAG register to determine which interrupt condition is present.
Note:
Interrupts must be globally enabled for interrupt requests to be generated. Refer to the Nested
Vector Interrupt Controller for details.
Related Links
Nested Vector Interrupt Controller
on page 44
25.6.5. Events
The RTC can generate the following output events:
•
Overflow (OVF): Generated when the counter has reached its top value and wrapped to zero.
•
Tamper (TAMPER): Generated on detection of valid signal on a tamper input pin or tamper event
input.
•
Compare (CMPn): Indicates a match between the counter value and the compare register.
•
Alarm (ALARM): Indicates a match between the clock value and the alarm register.
•
Period n (PERn): The corresponding bit in the prescaler has toggled. Refer to
details.
Setting the Event Output bit in the Event Control Register (EVCTRL.xxxEO=1) enables the corresponding
output event. Writing a zero to this bit disables the corresponding output event. Refer to the EVSYS -
Event System for details on configuring the event system.
The RTC can take the following actions on an input event:
•
Tamper (TAMPEVT): Capture the RTC counter to the timestamp register. See
Tamper Detection
.
Writing a one to an Event Input bit into the Event Control register (EVCTRL.xxxEI) enables the
corresponding action on input event. Writing a zero to this bit disables the corresponding action on input
event.
Related Links
25.6.6. Sleep Mode Operation
The RTC will continue to operate in any sleep mode where the source clock is active. The RTC
interrupts
can be used to wake up the device from a sleep mode. RTC
events
can trigger other operations in the
system without exiting the sleep mode.
An interrupt request will be generated after the wake-up if the Interrupt Controller is configured
accordingly. Otherwise the CPU will wake up directly, without triggering any interrupt. In this case, the
CPU will continue executing right from the first instruction that followed the entry into sleep.
The periodic events can also wake up the CPU through the interrupt function of the Event System. In this
case, the event must be enabled and connected to an event channel with its interrupt enabled. See
Event
System
for more information.
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
338