23.3.1.2 Configure RTC
To operate the RTC, follow these steps:
- Set the compare value in the Compare register (RTC.CMP), and/or the overflow value in the Top register (RTC.PER).
- Enable the desired interrupts by writing to the respective Interrupt Enable bits (CMP, OVF) in the Interrupt Control register (RTC.INTCTRL).
- Configure the RTC internal prescaler and enable the RTC by writing the desired value to the PRESCALER bit field and a '1' to the RTC Enable bit (RTCEN) in the Control A register (RTC.CTRLA).
Note: The RTC peripheral is
used internally during device start-up. Always check the Busy bits in
the RTC.STATUS and RTC.PITSTATUS registers, also on initial
configuration.