21.7.1 Control A
| Name: | CTRLA |
| Offset: | 0x00 |
| Reset: | 0x0000 |
| Property: | PAC Write-Protection, Enable-Protected, Write-Synchronized |
| Bit | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | |
| COUNTSYNC | PRESCALER[3:0] | ||||||||
| Access | R/W | R/W | R/W | R/W | R/W | ||||
| Reset | 0 | 0 | 0 | 0 | 0 | ||||
| Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
| MODE[1:0] | ENABLE | SWRST | |||||||
| Access | R/W | R/W | R/W | R/W | |||||
| Reset | 0 | 0 | 0 | 0 | |||||
Bit 15 – COUNTSYNC COUNT Read Resynchronization Enable
| Value | Description |
|---|---|
| 0 | Continuous read resynchronization of COUNT is disabled. The values in COUNT are not continuously updated and are invalid. |
| 1 | Continuous read resynchronization of COUNT is enabled. The values in COUNT are continuously updated and valid. |
Bits 11:8 – PRESCALER[3:0] Prescaler
| Value | Name | Description |
|---|---|---|
| 0x0 | OFF | CLK_RTC_CNT = GCLK_RTC/1 |
| 0x1 | DIV1 | CLK_RTC_CNT = GCLK_RTC/1 |
| 0x2 | DIV2 | CLK_RTC_CNT = GCLK_RTC/2 |
| 0x3 | DIV4 | CLK_RTC_CNT = GCLK_RTC/4 |
| 0x4 | DIV8 | CLK_RTC_CNT = GCLK_RTC/8 |
| 0x5 | DIV16 | CLK_RTC_CNT = GCLK_RTC/16 |
| 0x6 | DIV32 | CLK_RTC_CNT = GCLK_RTC/32 |
| 0x7 | DIV64 | CLK_RTC_CNT = GCLK_RTC/64 |
| 0x8 | DIV128 | CLK_RTC_CNT = GCLK_RTC/128 |
| 0x9 | DIV256 | CLK_RTC_CNT = GCLK_RTC/256 |
| 0xA | DIV512 | CLK_RTC_CNT = GCLK_RTC/512 |
| 0xB | DIV1024 | CLK_RTC_CNT = GCLK_RTC/1024 |
| Other | — | Reserved |
Bits 3:2 – MODE[1:0] Operating Mode
| Value | Name | Description |
|---|---|---|
| 0x0 | COUNT32 | Mode 0: 32-bit counter |
| 0x1 | COUNT16 | Mode 1: 16-bit counter |
| 0x2 | CLOCK | Mode 2: Clock/calendar |
| Other | — | Reserved |
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.
| Value | Description |
|---|---|
| 0 | The RTC is or being disabled |
| 1 | The 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.
- This bit is not enable protected.
- Writing a ‘
1’ to CTRL.SWRST will always take precedence, meaning that all other writes in the same write operation will be discarded. - The RTC should be disabled before the RTC is reset to avoid undefined behavior.
| Value | Description |
|---|---|
| 0 | There is no reset operation ongoing |
| 1 | The reset operation is ongoing |
