<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > s3c6410硬件RTC實(shí)時(shí)時(shí)鐘

s3c6410硬件RTC實(shí)時(shí)時(shí)鐘

作者: 時(shí)間:2016-11-09 來(lái)源:網(wǎng)絡(luò ) 收藏
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.

本文引用地址:http://dyxdggzs.com/article/201611/317626.htm

當系統電源關(guān)閉時(shí),通過(guò)備用電源可以運行實(shí)時(shí)時(shí)鐘(RTC)單元。數據包含的時(shí)間,即秒,分鐘,小時(shí),日期,日,月和年。RTC 工作由一個(gè)外部32.768kHz 的晶體驅動(dòng),并可以執行報警功能。

2、FEATURES特性

The Real Time Clock includes the following features:
• BCD number: second, minute, hour, date, day, month, and year. BCD編碼。
• Leap year generator閏年發(fā)生器。
• Alarm function: alarm-interrupt or wake-up from power-off mode.報警功能:報警中斷或從斷電模式中喚醒。
• Tick counter function: tick-interrupt or wake-up from power-off mode.時(shí)鐘計數功能:時(shí)鐘節拍中斷或從斷電模式中喚醒。
• Year 2000 problem is removed.這個(gè)在下面說(shuō),千年蟲(chóng)問(wèn)題。
• Independent power pin (RTCVDD).
• Supports millisecond tick time interrupt for RTOS kernel time tick.可以用于實(shí)時(shí)操作系統的系統時(shí)鐘

3、REAL TIME CLOCK OPERATION DESCRIPTION實(shí)時(shí)時(shí)鐘的結構框圖

3.1、 LEAP YEAR GENERATOR閏年發(fā)生器

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.

閏年發(fā)生器通過(guò)BCDDAY, BCDMON 和BCDYEAR 的數據來(lái)決定每個(gè)月的最后一天是28,29,30 還是31。
這個(gè)模塊是通過(guò)決定最后的日期來(lái)判斷閏年的。一個(gè)8 位的計數器只能代表兩個(gè)BCD 數字,因此它不能決
定‘00’年(年的最后兩個(gè)數字為‘00’)是不是閏年. 舉例來(lái)說(shuō),它不能區分1900 年和2000 年。要解決這個(gè)問(wèn)題,S3C6410 中的實(shí)時(shí)時(shí)鐘模塊,在2000 年中,硬連接邏輯支持閏年。注意1900 年不是閏年,
而2000 年是閏年。因此在S3C6410 中的‘00’的兩個(gè)數字表示2000 而不是1900。所以6410支持1901年到2099年。

3.2、READ/WRITE REGISTER讀寫(xiě)寄存器

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 必須被設置為高位,為了是可以寫(xiě)入實(shí)時(shí)時(shí)鐘模塊中的BCD 寄存器,以顯示秒,分鐘,小時(shí),日期,日,月和年。CPU 必須分別在RTC 模塊的BCDSEC, BCDMIN, BCDHOUR, BCDDATE, BCDDAY,
BCDMON 和 BCDYEAR 寄存器中讀取數據。但是,因為多個(gè)寄存器被讀取,所以可能有一秒的偏差存在。例
如,當用戶(hù)從BCDYEAR 到BCDMIN 讀取寄存器時(shí),結果假設為2059(年),12(月),31(日期),23(小時(shí))
和59(分鐘)。當用戶(hù)讀取BCDSEC 寄存器及值范圍從1 到59(秒)時(shí),沒(méi)有問(wèn)題,但值為0 秒,年,月,日,小時(shí)和分鐘將被改變?yōu)?060(年),1(月),1(日期),0(小時(shí))和0(分鐘),就是因為這一秒的變差。在這種情況下,如果BCDSEC 置0,用戶(hù)必須從BCDYEAR 到BCDSEC 重新讀取。

3.4 、ALARM FUNCTION報警功能,可以對照看上面的那個(gè)結構框圖
The RTC generates ALARM_INT(alarm interrupt) and ALARM_WK(alarm wake-up) at a specified time in the
power-down mode, power off mode or normal operation mode.

實(shí)時(shí)時(shí)鐘在斷電模式或正常操作模式的某一特定時(shí)間內產(chǎn)生一個(gè)報警信號

In normal operation mode, If ALARM registervalue is a same to BCD register, ALARM_INT is activated as well as the ALARM_WK.正常模式下,ALARM_INT和ALARM_WK都被激活

In the power-off and powerdown,If ALARM register value is a same to BCD register,ALARM_WK is activated.在斷電模式下或省電模式下,ALARM_WK被激活

The RTC alarm register(RTCALM) determines the alarm enable/disable status and the condition of the alarm time setting.實(shí)時(shí)時(shí)鐘報警寄存器(RTCALM),決定了報警啟用/禁用的狀態(tài)和報警時(shí)間設置的條件

3.5、 TICK TIME INTERRUPT 中斷

The RTC tick time is used for interrupt request. TheRTCCON[8]register has an interrupt enable bit. The count
value reaches ‘0’ when the tick time interrupt occurs.實(shí)時(shí)時(shí)鐘標記時(shí)間被用于中斷請求。TICNT寄存器有一個(gè)中斷使能位和一個(gè)相關(guān)的計數器值。每個(gè)時(shí)鐘脈沖,計數值減一。當TICK TIME中斷發(fā)生計數器的值達到‘0’,TICK TIME中斷發(fā)生。中斷周期

Then the period of interrupt is as follows:
Period = (n+1)/32768 second (n= tick counter value)

看下圖,那個(gè)32768是可選的。


這個(gè)和下面這個(gè)寄存器有關(guān):



公式中的n= tick counter value和下面這個(gè)寄存器有關(guān):


3.6、 32.768 KHZ X-TAL CONNECTION EXAMPLE時(shí)鐘晶振電路

4、寄存器:

s3c6410的RTC在linux中的驅動(dòng)(1)的鏈接地址



評論


技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>