13.3.1 Counter
The RTCC consists of two counters; the 32-bit main counter, RTCC_CNT (RTCC_TIME and RTCC_DATE in calendar mode), and a 15-
bit pre-counter, RTCC_PRECNT. The pre-counter can be used as an independent counter or to generate a specific frequency for the
main counter. In both configurations, the pre-counter can be used to generate compare match events or be captured in the Capture/
Compare channels as a result of an external PRS event. Refer to
13.3.2 Capture/Compare Channels
for details on how to configure the
Capture/Compare channels for use with the pre-counter.
RTCC_PRECNT
RTCC_CNT /
RTCC_TIME, RTCC_DATE
LFCLK
RTCC
RTCC_CTRL_CNTTICK
=
.........................
RTCC_CC0_CCV[14:0]
RTCC_CTRL_CNTPRESC
PRESC
CCV0MATCH
Figure 13.2. RTCC counters
The RTCC is enabled by setting the ENABLE bit in RTCC_CTRL. When the RTCC is enabled, the pre-counter (RTCC_PRECNT) incre-
ments upon each positive clock edge of LFCLK
RTCC
. If CNTTICK in RTCC_CTRL is set to PRESC, the pre-counter will continue to
count up, wrapping around to zero when it overflows. If CNTTICK in RTCC_CTRL is set to CCV0MATCH, the pre-counter will wrap
around when it hits the value configured in RTCC_CC0_CCV.
The main counter of the RTCC, RTCC_CNT, has two modes; normal mode and calendar mode. In normal mode, the main counter is
available in RTCC_CNT and increments upon each tick given from the pre-counter. Refer to
for a description on
how to configure the frequency of these ticks. In calendar mode, the counter value is available in RTCC_TIME and RTCC_DATE, keep-
ing track of seconds, minutes, hours, day of month, day of week, months, and years, all encoded in BCD format. Refer to
for details on this mode. The mode of the main counter is configured in CNTMODE in RTCC_CTRL. The differ-
ences between the two modes are summarized below.
•
Normal mode
• Incremental counter, RTCC_CNT.
• RTCC_CCx_CCV used for Capture/Compare value.
•
Calendar mode
• BCD counters, RTCC_DATE, RTCC_TIME.
• RTCC_CCx_TIME and RTCC_CCx_DATE used for Capture/Compare value.
Note:
The mode of the RTCC must be configured for CALENDAR mode in RTCC_CTRL_CNTMODE before writing to the mode de-
pendent registers, RTCC_TIME, RTCC_DATE, RTCC_CCx_TIME, and RTCC_CCx_DATE. Writes to these registers when in NORMAL
mode will be ignored.
Reference Manual
RTCC - Real Time Counter and Calendar
silabs.com
| Building a more connected world.
Rev. 1.1 | 378