
NUC126
Aug. 08, 2018
Page
519
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
RTC Time Counter
Control Unit
Time Loading
Register
(RTC_TIME)
Calendar
Loading
Register
(RTC_CAL)
Time Alarm
Register
(RTC_TALM)
Calendar
Alarm Register
(RTC_CALM)
1/128 change
1/64 change
1/32 change
1/16 change
1/8 change
1/4 change
1/2 change
1 change
(sec)
111
110
101
100
011
010
001
000
TICK (RTC_TICK[2:0])
TICKIF (RTC_INTSTS[1])
TICKIEN (RTC_INTEN[1])
Compare
Operation
ALMIEN (RTC_INTEN[0])
Alarm Interrupt
RTC_CLK
Frequency
Compensation
Frequency
Compensation
Register
(RTC_FREQADJ)
RWEN
WEEKDAY
LEAPYEAR
24H/12H
ALMIF (RTC_INTSTS[0])
Wakeup CPU from
Power-down mode
Tick Interrupt
Time Alarm
Mask Register
(RTC_TAMSK)
Calendar Alarm
Mask Register
(RTC_CAMSK)
LIRC
0
1
RTCSEL
(CLK_CLKSEL2[18])
LXT
INIT
INIT
RWEN
LEAPYEAR
CLKFMT
WEEKDAY
Figure 6.14-1 RTC Block Diagram
6.14.4
Basic Configuration
Clock Source Configuration
–
Select the source of RTC on RTCSEL (CLK_CLKSEL2[18]).
Group
Pin Name
GPIO
MFP
X32
X32_IN
PF.1
MFP1
X32_OUT
PF.0
MFP1
6.14.5
Functional Description
6.14.5.1 RTC Initiation
When an RTC block is powered on, RTC is at reset state. User has to write a special number
0xA5EB1357 to INIT (RTC_INIT[31:0]) to make RTC leaving reset state. Once INIT has written as
0xA5EB1357, the RTC will be in normal active state permanently. User can read ACTIVE
(RTC_INIT[0]) to check the RTC is at normal active state or reset state.
6.14.5.2 RTC Read/Write Enable
The RWEN (RTC_RWEN[15:0]) is served as unlock write-protection function of RTC registers. If
RWEN is written to 0xA965, user can read RWENF (RTC_RWEN[16]) to check the RTC registers are
write accessible or locked. Once RWENF bit has been set, RTC write accessible period will keep effect
at least 1024 RTC clocks (about 30ms, if RTC clock source is LXT) and RWENF will be cleared
automatically after 1024 RTC clocks expired. If user writes RWEN 0xA965 during RWENF flag high,
the write accessible period will be auto extended from 768 ~1024 RTC clocks. Table 6.14-1 shows the
read/write access attribute of RTC registers.
Register
INIR = 0
RWENF = 1
RWENF = 0 Or RTCBUSY = 1