微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > s3c6410硬件RTC实时时钟

s3c6410硬件RTC实时时钟

时间:11-09 来源:互联网 点击:
1、OVERVIEW综述
The Real Time Clock (RTC) unit can be operated by the backup battery when the system power is off. The data
include the time by second, minute, hour, date, day, month, and year. The RTC unit works with an external 32.768

KHz crystal and can perform the alarm function.

当系统电源关闭时,通过备用电源可以运行实时时钟(RTC)单元。数据包含的时间,即秒,分钟,小时,日期,日,月和年。RTC 工作由一个外部32.768kHz 的晶体驱动,并可以执行报警功能。

2、FEATURES特性

The Real Time Clock includes the following features:
• BCD number: second, minute, hour, date, day, month, and year. BCD编码。
• Leap year generator闰年发生器。
• Alarm function: alarm-interrupt or wake-up from power-off mode.报警功能:报警中断或从断电模式中唤醒。
• Tick counter function: tick-interrupt or wake-up from power-off mode.时钟计数功能:时钟节拍中断或从断电模式中唤醒。
• Year 2000 problem is removed.这个在下面说,千年虫问题。
• Independent power pin (RTCVDD).
• Supports millisecond tick time interrupt for RTOS kernel time tick.可以用于实时操作系统的系统时钟

3、REAL TIME CLOCK OPERATION DESCRIPTION实时时钟的结构框图

3.1、 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
BCDDAY, BCDMON, and BCDYEAR. This block considers leap year in deciding on the last date. An 8-bit counter
can only represent 2 BCD digits, therefore it cannot decide whether “00” year (the year with its last two digitszeros) is a leap year or not.To solve this problem,the RTC block in 6410 has hard-wired logic to support the leap year in 2000. Note 1900 is not leap year while2000 is leap year. Therefore, two digits of 00 in 6410 denote 2000, not 1900.So, RTC in 6410 supports from 1901 to 2099.

闰年发生器通过BCDDAY, BCDMON 和BCDYEAR 的数据来决定每个月的最后一天是28,29,30 还是31。
这个模块是通过决定最后的日期来判断闰年的。一个8 位的计数器只能代表两个BCD 数字,因此它不能决
定‘00’年(年的最后两个数字为‘00’)是不是闰年. 举例来说,它不能区分1900 年和2000 年。要解决这个问题,S3C6410 中的实时时钟模块,在2000 年中,硬连接逻辑支持闰年。注意1900 年不是闰年,
而2000 年是闰年。因此在S3C6410 中的‘00’的两个数字表示2000 而不是1900。所以6410支持1901年到2099年。

3.2、READ/WRITE REGISTER读写寄存器

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.

RTCCON 寄存器的位0 必须被设置为高位,为了是可以写入实时时钟模块中的BCD 寄存器,以显示秒,分钟,小时,日期,日,月和年。CPU 必须分别在RTC 模块的BCDSEC, BCDMIN, BCDHOUR, BCDDATE, BCDDAY,
BCDMON 和 BCDYEAR 寄存器中读取数据。但是,因为多个寄存器被读取,所以可能有一秒的偏差存在。例
如,当用户从BCDYEAR 到BCDMIN 读取寄存器时,结果假设为2059(年),12(月),31(日期),23(小时)
和59(分钟)。当用户读取BCDSEC 寄存器及值范围从1 到59(秒)时,没有问题,但值为0 秒,年,月,日,小时和分钟将被改变为2060(年),1(月),1(日期),0(小时)和0(分钟),就是因为这一秒的变差。在这种情况下,如果BCDSEC 置0,用户必须从BCDYEAR 到BCDSEC 重新读取。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top