Datasheet

Real Time Clock (RTC)
Data Sheet MC68HC908LJ24/LK24 — Rev. 2.1
228 Real Time Clock (RTC) Freescale Semiconductor
The mechanism uses the RTCWE[1:0] bits in the RTC calibration control
register (RTCCOMR) in a state machine, which requires a bit-write
sequence to disable the write-protection. A block diagram of the state
machine is shown in Figure 12-5.
Figure 12-5. RTC Write Protect State Diagram
After a reset, the write-protect mechanism is disabled, allowing the user
code to calibrate the RTC clock, set the time in the clock registers, and
set the date in the calendar registers.
To enable write-protect after reset or write-protect is disabled execute
the following code:
RTCWE1 EQU 1 ;RTCWE1 bit
RTCWE0 EQU 0 ;RTCWE0 bit
W
r
i
t
e
0
1
t
o
R
T
C
W
E
W
r
i
t
e
1
0
t
o
R
T
C
W
E
W
r
i
t
e
a
n
y
v
a
l
u
e
o
t
h
e
r
t
h
a
n
1
0
t
o
R
T
C
W
E
W
r
i
t
e
a
n
y
v
a
l
u
e
o
t
h
e
r
t
h
a
n
1
1
t
o
R
T
C
W
E
W
r
i
t
e
1
1
t
o
RT
CW
E
Write-Protect ENABLED
W
r
i
t
e
a
n
y
v
a
l
u
e
o
t
h
e
r
W
r
i
t
e
0
0
t
o
R
T
C
W
E
RTCWE = 11
RTCWE = 10
R
E
S
E
T
Write any value
other than 00
to RTWE
RTCWE = 00
RTCWE 01
Write any value
other than 10
to RTWE
t
h
a
n
0
1
t
o
R
T
C
W
E
Write-Protect
DISABLED
W
r
i
t
e
1
0
t
o
R
T
C
W
E
Note: Reading RTCWE[1:0]
always return 00.