25.6.8.1 Periodic Intervals

The RTC prescaler can generate interrupts and events at periodic intervals, allowing flexible system tick creation. Any of the upper eight bits of the prescaler (bits 2 to 9) can be the source of an interrupt/event. When one of the eight Periodic Event Output bits in the Event Control register (EVCTRL.PEREO[n=0..7]) is ‘1’, an event is generated on the 0-to-1 transition of the related bit in the prescaler, resulting in a periodic event frequency of:

fPERIODIC(n)=fCLK_RTC_OSC2n+3

fCLK_RTC_OSC is the frequency of the internal prescaler clock CLK_RTC_OSC, and n is the position of the EVCTRL.PEREOn bit. For example, PER0 generates an event every eight CLK_RTC_OSC cycles, PER1 every 16 cycles and so on. This is illustrated in the following figure.

Periodic events are independent of the prescaler setting used by the RTC counter, except if CTRLA.PRESCALER is ‘0’. Then, no periodic events are generated.

Figure 25-5. Example Periodic Events
Note: This example also applies to interrupts. Just replace EVCTRL.PEREOn with the PERn fields of INTENCLR, INTENSET and INTFLAG. For Modes 0 and 2, n = 0,..7. For Mode 1 n = 2...7.