21.8.1 Control A

Name: CTRLA
Offset: 0x00
Reset: 0x0000
Property: PAC Write-Protection, Enable-Protected, Write-Synchronized

Bit 15141312111098 
 CLOCKSYNC   PRESCALER[3:0] 
Access R/WR/WR/WR/WR/W 
Reset 00000 
Bit 76543210 
 MATCHCLRCLKREP  MODE[1:0]ENABLESWRST 
Access R/WR/WR/WR/WR/WR/W 
Reset 000000 

Bit 15 – CLOCKSYNC CLOCK Read Resynchronization Enable

This bit controls the continuous read resynchronization of the CLOCK register.
Note: This bit is not enable-protected.
ValueDescription
0 Continuous read resynchronization of CLOCK is disabled. The values in CLOCK are not continuously updated and are invalid.
1 Continuous read resynchronization of CLOCK is enabled. The values in CLOCK are continuously updated and valid.

Bits 11:8 – PRESCALER[3:0] Prescaler

This bit field controls the prescaling factor for the RTC clock source (CLK_RTC_OSC) to generate the counter clock (CLK_RTC_CNT). Periodic events and interrupts are not available when the prescaler is off.
Note: This bit field is not synchronized.
ValueNameDescription
0x0OFFCLK_RTC_CNT = GCLK_RTC/1
0x1DIV1CLK_RTC_CNT = GCLK_RTC/1
0x2DIV2CLK_RTC_CNT = GCLK_RTC/2
0x3DIV4CLK_RTC_CNT = GCLK_RTC/4
0x4DIV8CLK_RTC_CNT = GCLK_RTC/8
0x5DIV16CLK_RTC_CNT = GCLK_RTC/16
0x6DIV32CLK_RTC_CNT = GCLK_RTC/32
0x7DIV64CLK_RTC_CNT = GCLK_RTC/64
0x8DIV128CLK_RTC_CNT = GCLK_RTC/128
0x9DIV256CLK_RTC_CNT = GCLK_RTC/256
0xADIV512CLK_RTC_CNT = GCLK_RTC/512
0xBDIV1024CLK_RTC_CNT = GCLK_RTC/1024
OtherReserved

Bit 7 – MATCHCLR Clear on Match

This bit controls whether the counter is cleared on a match.
Note: This bit is not synchronized.
ValueDescription
0The counter is not cleared on a Compare/Alarm match
1The counter is cleared on a Compare/Alarm match

Bit 6 – CLKREP Clock Representation

This bit determines how the hours are represented in the Clock Value (CLOCK) register.
Note: This bit is not synchronized.
ValueNameDescription
0 CLK24H 24 hour clock format
1 CLK12H 12 hour (AM/PM) clock format

Bits 3:2 – MODE[1:0] Operating Mode

This bit field controls the operating mode of the RTC.
Note: This bit field is not synchronized.
ValueNameDescription
0x0COUNT32Mode 0: 32-bit counter
0x1COUNT16Mode 1: 16-bit counter
0x2CLOCKMode 2: Clock/calendar
OtherReserved

Bit 1 – ENABLE Enable

This bit controls whether the RTC is enabled.

Due to synchronization, there is a delay from writing to CTRLA.ENABLE until the RTC is enabled or disabled. The value written to CTRLA.ENABLE will be read back immediately and the Enable bit in the Synchronization Busy register (SYNCBUSY.ENABLE) will be set. SYNCBUSY.ENABLE will be cleared when the operation is complete.

Note: This bit is not enable-protected.
ValueDescription
0The RTC is or being disabled
1The RTC is or being enabled

Bit 0 – SWRST Software Reset

Writing a ‘0’ to this bit has no effect.

Writing a ‘1’ to this bit resets all registers in the RTC, except DBGCTRL, to their initial state, and the RTC will be disabled.

Due to synchronization, there is a delay from writing to CTRLA.SWRST until the reset is complete. CTRLA.SWRST and SYNCBUSY.SWRST will both be cleared when the reset is complete.

Note:
  1. This bit is not enable protected.
  2. Writing a ‘1’ to CTRL.SWRST will always take precedence, meaning that all other writes in the same write operation will be discarded.
  3. The RTC should be disabled before the RTC is reset to avoid undefined behavior.
ValueDescription
0There is no reset operation ongoing
1The reset operation is ongoing