Autoincrement Feature
For ease of reading and writing the 32-bit CAPTURE and ALARM values, RTC0ADR automatically increments after each read or write
to a CAPTUREn or ALARMn register. This speeds up the process of setting an alarm or reading the current RTC timer value. Auto-
increment is always enabled. The recommended instruction timing for a multi-byte register read with short strobe and auto read enabled
is as follows:
mov RTC0ADR, #0d0h
nop
nop
nop
mov A, RTC0DAT
nop
nop
mov A, RTC0DAT
nop
nop
mov A, RTC0DAT
nop
nop
mov A, RTC0DAT
The recommended instruction timing for a multi-byte register write with short strobe enabled is as follows:
mov RTC0ADR, #010h
mov RTC0DAT, #05h
nop
mov RTC0DAT, #06h
nop
mov RTC0DAT, #07h
nop
mov RTC0DAT, #08h
nop
9.3.2 Clocking Options
Using an External Crystal or CMOS Clock
When using crystal mode, a 32.768 kHz crystal should be connected between XTAL3 and XTAL4. No other external components are
required. The following steps show how to start the RTC crystal oscillator in software:
1. If XTAL3 and XTAL4 are shared with standard GPIO functionality, set these pins to analog mode. If they XTAL3 and XTAL4 are
dedicated pins, skip this step.
2. Set RTC to crystal mode (XMODE = 1).
3. Disable automatic gain control (AGCEN) and enable bias doubling (BIASX2) for fast crystal startup.
4. Set the desired loading capacitance (RTC0XCF).
5. Enable power to the RTC oscillator circuit (RTC0EN = 1).
6. Wait 20 ms.
7. Poll the RTC clock valid flag (CLKVLD) until the crystal oscillator stabilizes.
8. Poll the RTC load capacitance ready flag (LOADRDY) until the load capacitance reaches its programmed value.
9. Enable automatic gain control (AGCEN) and disable bias doubling (BIASX2) for maximum power savings.
10. Enable the RTC missing clock detector.
11. Wait 2 ms.
12. Clear the PMU0CF wake-up source flags.
While configured for crystal mode, the RTC oscillator may be driven by an external CMOS clock. The CMOS clock should be applied to
XTAL3, while XTAL4 should be left floating. The RTC oscillator should be configured to its lowest bias setting with AGC disabled. The
CLKVLD bit is indeterminate when using a CMOS clock, but the OSCFAIL flag may be checked 2 ms after the RTC oscillator is pow-
ered on to ensure that there is a valid clock on XTAL3.
For devices with a dedicated XTAL3 pin, the input low voltage (VIL) and input high voltage (VIH) for XTAL3 when used with an external
CMOS clock are 0.1 and 0.8 V, respectively.
For devices where XTAL3 is shared with standard GPIO functionality, bias levels closer to VDD will result in lower I/O power consump-
tion because the XTAL3 pin has a built-in weak pull-up. In this mode, the external CMOS clock is ac coupled into the RTC and should
have a minimum voltage swing of 400 mV. The CMOS clock signal voltage should not exceed VDD or drop below GND.
EFM8SB2 Reference Manual
Real Time Clock (RTC0)
silabs.com
| Smart. Connected. Energy-friendly.
Rev. 0.1 | 63