1. 程式人生 > >7.S5PV210之RTC相關暫存器詳解

7.S5PV210之RTC相關暫存器詳解

1、Interrupt Pending Register (INTP, R/W, Address = 0xE280_0030)

中斷掛起暫存器:

You can clear specific bits of INTP register by writing 1’s to the bits that you want to clear regardless of RTCEN value.


不論RTCEN的值是多少,如果你想清除INTP特定的位可以通過對相應的位寫入1.

2、Real Time Clock Control Register (RTCCON, R/W, Address = 0xE280_0040)

RTC控制暫存器:

The RTCCON register consists of 10 bits such as the RTCEN, which controls the read/ write enable of the BCDSEL, CNTSEL, CLKRST, TICCKSEL and TICEN for testing, and CLKOUTEN for RTC clock output control.
RTCEN bit controls all interfaces between the CPU and the RTC, therefore it should be set to 1 in an RTC control routine to enable data read/ write after a system reset. To prevent inadvertent writing into BCD counter registers the RTCEN bit should be cleared to 0 before power off.
CLKRST is counter reset for 2
15 clock divider. Before RTC clock setting, 215 clock divider must be reset for exact RTC operation.
RTCCON暫存器包含10個位,如下圖所示。RTCEN控制CPU和RTC所有的介面,因此在系統復位後在RTC中使能相應的讀寫資料操作RTCEN應該被置1。為了防止因為資料意外寫到BCD計數器暫存器時,應該在電源關閉前將RTCEN位置0。

CLKRST是對2^15時鐘分頻器的計數器復位。在RTC時鐘設定之前,為了RTC精確的執行,2^15時鐘分頻器必須復位。

3、Tick Time Count Register (TICNT, R/W, Address = 0xE280_0044)



這個暫存器暫時我們不用,它一般用在作業系統中。

4、RTC Alarm Control Register (RTCALM, R/W, Address = 0xE280_0050)
The RTCALM register determines the alarm enable and the alarm time. Note that the RTCALM register
generates the alarm signal through both ALARM_INT and ALARM_WK in power down mode, but only through ALARM_INT in the normal operation mode. Enable ALMEN to use ALARM_INT and ALARM_WK.
If compare value is year, ALMEN and YEAREN must be enabled. If compare values are year, month, day, hour,min and sec, ALMEN, YEAREN, MONEN, DAYEN, HOUREN, MINEN and SECEN must be enabled.
 

RTC鬧鐘控制暫存器: RTCALM暫存器決定使能鬧鐘和設定鬧鐘時間。注意:RTCALM暫存器產生鬧鐘訊號,在斷電模式下通過鬧鐘中斷和鬧鐘喚醒訊號,在正常執行模式下只能通過鬧鐘中斷訊號。使能ALMEN後使用鬧鐘中斷和鬧鐘喚醒訊號。如果比較的是隻是年份則必須同時ALMEN和YEAREN使能。如果是年月日時分秒則必須ALMEN, YEAREN, MONEN, DAYEN, HOUREN, MINEN and SECEN都使能。

5、Alarm Second Data Register (ALMSEC, R/W, Address = 0xE280_0054)
設定鬧鐘的秒數暫存器


下面這幾個也是設定鬧鐘相關日期/時間的暫存器:



下面這幾個是設定正常時實時時鐘的時間暫存器:





最後一個是設定TICK相關的暫存器,暫時我們還不用: