eZ80F91 ASSP
Product Specification
157
•
Write to RTC_CTRL to set RTC_UNLOCK and disable the RTC counter; this action
also clears the clock divider
•
•
•
Write values to the RTC count registers to set the current time
Write values to the RTC alarm registers to set the appropriate alarm conditions
Write to RTC_CTRL to clear RTC_UNLOCK; clearing the RTC_UNLOCK bit resets
and enables the clock divider
Real-Time Clock Registers
The RTC registers are accessed via the address and data buses using I/O instructions. The
RTC_UNLOCK control bit controls access to the RTC count registers. When unlocked
(RTC_UNLOCK = 1), the RTC count is disabled and the count registers are read/write.
When locked (RTC_UNLOCK = 0), the RTC count is enabled and the count registers are
read-only. The default at RESET is for the RTC to be locked.
Real-Time Clock Seconds Register
This register contains the current seconds count. The value in the RTC_SEC Register is
unchanged by a RESET. The current setting of BCD_EN determines whether the values in this
register are binary (BCD_EN = 0) or binary-coded decimal (BCD_EN = 1). Access to this reg-
ister is read-only if the RTC is locked, and read/write if the RTC is unlocked. See Table 80.
Table 80. Real-Time Clock Seconds Register (RTC_SEC)
Bit
7
6
5
4
3
2
1
0
Field
Reset
R/W
TEN_SEC
SEC
U
U
U
U
U
U
U
U
R/W*
R/W*
R/W*
R/W*
R/W*
R/W*
R/W*
R/W*
Address
00E0h
Note: U = Unchanged by RESET; R/W* = read only if RTC locked, read/write if RTC unlocked.
Binary-Coded Decimal Operation (BCD_EN = 1)
Bit
Description
[7:4]
TEN_SEC
Seconds: Tens
0–5: The tens digit of the current seconds count.
[3:0]
SEC
Seconds: Ones
0–9: The ones digit of the current seconds count.
Binary Operation (BCD_EN = 0)
[7:0]
SEC
Seconds
00h–3Bh: The current seconds count.
PS027004-0613
P R E L I M I N A R Y
Real-Time Clock