7 real time clock (rtc), 1 overview, 2 rtc features – Rainbow Electronics NUC130 User Manual
Page 40: Real time clock (rtc), Overview, Rtc features, Nuc130 series data sheet

NUC130 Series DATA SHEET
Publication Release Date: May 31, 2010
- 40 -
Revision V1.02
5.7
Real Time Clock (RTC)
5.7.1
Overview
Real Time Clock (RTC) unit provides user the real time and calendar message. The clock source of 
RTC is from an external 32.768KHz crystal connected at pins X32I and X32O or from an external 
32.768KHz oscillator output fed at pin X32I. The RTC unit provides the time message(second, minute, 
hour) in Time Loading Register (TLR) as well as calendar message(day, month, year) in Calendar 
Loading Register (CLR). The data message is expressed in BCD format. This unit offers alarm 
function that user can preset the alarm time in Time Alarm Register (TAR) and alarm calendar in 
Calendar Alarm Register (CAR). 
The RTC unit supports periodic Time Tick and Alarm Match interrupts. The periodic interrupt has 8 
period options 1/128, 1/64, 1/32, 1/16, 1/8, 1/4, 1/2 and 1 second which are selected by 
TTR(TTR[2:0]). When RTC counter in TLR and CLR is equal to alarm setting time registers TAR and 
CAR, the alarm interrupt flag (RIIR.AIF) is set and the alarm interrupt is requested if the alarm interrupt 
is enabled (RIER.AIER=1). The RTC Time Tick and Alarm Match can cause CPU wakeup from sleep 
or power-down mode if Wakeup CPU function is enabled(TWKE(TTR[3])=1). 
5.7.2
RTC Features
y
There is a time counter (second, minute, hour) and calendar counter (day, month, year) for user 
to check the time. 
y
Alarm register (second, minute, hour, day, month, year).
y
12-hour or 24-hour mode is selectable.
y
Leap year compensation automatically.
y
Day of week counter.
y
Frequency compensate register (FCR).
y
All time and calendar message is expressed in BCD code.
y
Support periodic time tick interrupt with 8 period options 1/128, 1/64, 1/32, 1/16, 1/8, 1/4, 1/2 and 
1 second. 
y
Support RTC Time Tick and Alarm Match interrupt
y
Support wake up CPU from sleep or power-down mode.
