21.4.1 Initialization

To initialize and run the RTC in basic 32-bit counter mode, follow these steps:

  1. Configure the mode of operation to 32-bit counter (CTRLA.MODE).
  2. Enable continuous read resynchronization of the counter and wait for the operation to complete (CTRLA.COUNTSYNC and SYNCBUSY.COUNTSYNC).
  3. Configure the counter value (COUNT.COUNT).
  4. Enable the Overflow interrupt (INTENSET.OVF).
  5. Enable the RTC and wait for the operation to complete (CTRLA.ENABLE and SYNCBUSY.ENABLE).
  6. Wait for the Overflow interrupt flag to be set when the RTC has overflowed (INTFLAG.OVF).