Real-time clock (RTC)
RM0365
725/1080
DocID025202 Rev 7
The RTC includes:
•
Two alarms
•
Three tamper events from I/Os
–
Tamper detection erases the backup registers.
•
One timestamp event from I/O
•
Tamper event detection can generate a timestamp event
•
16 x 32-bit backup registers in STM32F302xB/C and 5 x 32-bit backup registers in
STM32F302x6/8
–
The backup registers (RTC_BKPxR) are implemented in the RTC domain that
remains powered-on by VBAT when the VDD power is switched off.
•
Alternate function outputs: RTC_OUT which selects one of the following two outputs:
–
RTC_CALIB: 512 Hz or 1Hz clock output (with an LSE frequency of 32.768 kHz).
This output is enabled by setting the COE bit in the RTC_CR register.
–
RTC_ALARM: This output is enabled by configuring the OSEL[1:0] bits in the
RTC_CR register which select the Alarm A, Alarm B or Wakeup outputs.
•
Alternate function inputs:
–
RTC_TS: timestamp event
–
RTC_TAMP1: tamper1 event detection
–
RTC_TAMP2: tamper2 event detection
–
RTC_TAMP3: tamper3 event detection
–
RTC_REFIN: 50 or 60 Hz reference clock input
27.3.2
GPIOs controlled by the RTC
RTC_OUT, RTC_TS and RTC_TAMP1 are mapped on the same pin (PC13).
The selection of the RTC_ALARM output is performed through the RTC_TAFCR register as
follows: the PC13VALUE bit is used to select whether the RTC_ALARM output is configured
in push-pull or open drain mode.
When PC13 is not used as RTC alternate function, it can be forced in output push-pull mode
by setting the PC13MODE bit in the RTC_TAFCR. The output data value is then given by
the PC13VALUE bit. In this case, PC13 output push-pull state and data are preserved in
Standby mode.
The output mechanism follows the priority order shown in
When PC14 and PC15 are not used as LSE oscillator, they can be forced in output push-pull
mode by setting the PC14MODE and PC15MODE bits in the RTC_TAFCR register
respectively. The output data values are then given by PC14VALUE and PC15VALUE. In
this case, the PC14 and PC15 output push-pull states and data values are preserved in
Standby mode.
The output mechanism follows the priority order shown in
and
.