1. 程式人生 > >s3c6410硬體RTC(實時時鐘)

s3c6410硬體RTC(實時時鐘)

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, day, date, month, and year, the CPU must read the data in BCDSEC, BCDMIN, BCDHOUR,
BCDDATE, BCDDAY, 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 must reread
from BCDYEAR to BCDSEC if BCDSEC is zero.