REAL TIME CLOCK S3C2440A RISC MICROPROCESSOR
17-2
REAL TIME CLOCK OPERATION
2
15
Clock Divider
XTOrtc
XTIrtc
Control Register
SEC MIN HOUR DAY DATE MON YEAR
Leap Year Generator
Alarm Generator
Reset Register
1 Hz
INT_RTC
RTCCON RTCALM
RTCRST
Time Tick Generator
TIME TICKTICNT
128 Hz
PMWKUP
Figure 17-1. Real Time Clock Block Diagram
LEAP YEAR GENERATOR
The Leap Year Generator can determine the last date of each month out of 28, 29, 30, or 31, based on data from
BCDDATE, BCDMON, and BCDYEAR. This block considers leap year in deciding on the last date. An 8-bit
counter can only represent 2 BCD digits, so it cannot decide whether "00" year (the year with its last two digits
zeros) is a leap year or not. For example, it cannot discriminate between 1900 and 2000. To solve this problem,
the RTC block in S3C2440A has hard-wired logic to support the leap year in 2000. Note 1900 is not leap year while
2000 is leap year. Therefore, two digits of 00 in S3C2440A denote 2000, not 1900.
READ/WRITE REGISTERS
Bit 0 of the RTCCON register must be set high in order to write the BCD register in RTC block. To display the
second, minute, hour, date, month, and year, the CPU should read the data in BCDSEC, BCDMIN, BCDHOUR,
BCDDAY, BCDDATE, BCDMON, and BCDYEAR registers, respectively, in the RTC block. However, a one second
deviation may exist because multiple registers are read. For example, when the user reads the registers from
BCDYEAR to BCDMIN, the result is assumed to be 2059 (Year), 12 (Month), 31 (Date), 23 (Hour) and 59 (Minute).
When the user read the BCDSEC register and the value ranges from 1 to 59 (Second), there is no problem, but, if
the value is 0 sec., the year, month, date, hour, and minute may be changed to 2060 (Year), 1 (Month), 1 (Date), 0
(Hour) and 0 (Minute) because of the one second deviation that was mentioned. In this case, the user should re-
read from BCDYEAR to BCDSEC if BCDSEC is zero.
BACKUP BATTERY OPERATION
The RTC logic can be driven by the backup battery, which supplies the power through the RTCVDD pin into the
RTC block, even if the system power is off. When the system is off, the interfaces of the CPU and RTC logic
should be blocked, and the backup battery only drives the oscillation circuit and the BCD counters to minimize
power dissipation.