
RM0453 Rev 2
RM0453
Real-time clock (RTC)
1049
32.6.11
RTC timestamp time register (RTC_TSTR)
The content of this register is valid only when TSF is set to 1 in RTC_SR. It is cleared when
TSF bit is reset.
Address offset: 0x30
Backup domain reset value: 0x0000 0000
System reset: not affected
Bit 31
ADD1S
: Add one second
0: No effect
1: Add one second to the clock/calendar
This bit is write only and is always read as zero. Writing to this bit has no effect when a shift
operation is pending (when SHPF = 1, in RTC_ICSR).
This function is intended to be used with SUBFS (see description below) in order to
effectively add a fraction of a second to the clock in an atomic operation.
Bits 30:15 Reserved, must be kept at reset value.
Bits 14:0
SUBFS[14:0]
: Subtract a fraction of a second
These bits are write only and is always read as zero. Writing to this bit has no effect when a
shift operation is pending (when SHPF = 1, in RTC_ICSR).
The value which is written to SUBFS is added to the synchronous prescaler counter. Since
this counter counts down, this operation effectively subtracts from (delays) the clock by:
Delay (seconds) = SUBFS / (PR 1)
A fraction of a second can effectively be added to the clock (advancing the clock) when the
ADD1S function is used in conjunction with SUBFS, effectively advancing the clock by:
Advance (seconds) = (1 - (SUBFS / (PR 1))).
In mixed BCD-binary mode (BIN=10 or 11), the SUBFS[14:BCDU+8] must be written with 0.
Note: Writing to SUBFS causes RSF to be cleared. Software can then wait until RSF = 1 to be
sure that the shadow registers have been updated with the shifted time.
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
PM
HT[1:0]
HU[3:0]
r
r
r
r
r
r
r
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Res.
MNT[2:0]
MNU[3:0]
Res.
ST[2:0]
SU[3:0]
r
r
r
r
r
r
r
r
r
r
r
r
r
r
Bits 31:23 Reserved, must be kept at reset value.
Bit 22
PM
:
AM/PM notation
0: AM or 24-hour format
1: PM
Bits 21:20
HT[1:0]
: Hour tens in BCD format.
Bits 19:16
HU[3:0]
: Hour units in BCD format.
Bit 15 Reserved, must be kept at reset value.
Bits 14:12
MNT[2:0]
: Minute tens in BCD format.
Bits 11:8
MNU[3:0]
: Minute units in BCD format.