Real-time Clock Alarm and Parallel Load Interface Peripheral

RTC (AT91S_RTC) 0xFFFFFE00 (AT91C_BASE_RTC)
Periph ID AICSymbolDescription
1 (AT91C_ID_SYS)System Peripheral

FunctionDescription
AT91F_RTC_CfgPMCEnable Peripheral clock in PMC for RTC


RTC Software API (AT91S_RTC)

OffsetFieldDescription
0x0RTC_CRControl Register
0x4RTC_MRMode Register
0x8RTC_TIMRTime Register
0xCRTC_CALRCalendar Register
0x10RTC_TIMALRTime Alarm Register
0x14RTC_CALALRCalendar Alarm Register
0x18RTC_SRStatus Register
0x1CRTC_SCCRStatus Clear Command Register
0x20RTC_IERInterrupt Enable Register
0x24RTC_IDRInterrupt Disable Register
0x28RTC_IMRInterrupt Mask Register
0x2CRTC_VERValid Entry Register

FunctionDescription
AT91F_RTC_InterruptEnableEnable RTC Interrupt
AT91F_RTC_InterruptDisableDisable RTC Interrupt
AT91F_RTC_IsInterruptMaskedTest if RTC Interrupt is Masked
AT91F_RTC_GetInterruptMaskStatusReturn RTC Interrupt Mask Status

RTC Register Description

RTC: AT91_REG RTC_CR Control Register

OffsetNameDescription
0RTC_UPDTIM
AT91C_RTC_UPDTIM
Update Request Time Register
0 = No effect.
1 = Stops the RTC time counting.
Time counting consists of second, minute and hour counters. Time counters can be programmed once this bit is set and acknowledged by the bit ACKUPD of the Status Register.
1RTC_UPDCAL
AT91C_RTC_UPDCAL
Update Request Calendar Register
0 = No effect.
1 = Stops the RTC calendar counting.
Calendar counting consists of day, date, month, year and century counters. Calendar counters can be programmed once this bit is set.
9..8RTC_TIMEVSEL
AT91C_RTC_TIMEVSEL
Time Event Selection
The event that generates the flag TIMEV in RTC_SR (Status Register) depends on the value of TIMEVSEL.
ValueLabelDescription
0RTC_TIMEVSEL_MINUTE
AT91C_RTC_TIMEVSEL_MINUTE

Minute change.
1RTC_TIMEVSEL_HOUR
AT91C_RTC_TIMEVSEL_HOUR

Hour change.
2RTC_TIMEVSEL_DAY24
AT91C_RTC_TIMEVSEL_DAY24

Every day at midnight.
3RTC_TIMEVSEL_DAY12
AT91C_RTC_TIMEVSEL_DAY12

Every day at noon.
17..16RTC_CALEVSEL
AT91C_RTC_CALEVSEL
Calendar Event Selection
The event that generates the flag CALEV in RTC_SR depends on the value of CALEVSEL.
ValueLabelDescription
0RTC_CALEVSEL_WEEK
AT91C_RTC_CALEVSEL_WEEK

Week change (every Monday at time 00:00:00).
1RTC_CALEVSEL_MONTH
AT91C_RTC_CALEVSEL_MONTH

Month change (every 01 of each month at time 00:00:00).
2RTC_CALEVSEL_YEAR
AT91C_RTC_CALEVSEL_YEAR

Year change (every January 1 at time 00:00:00).

RTC: AT91_REG RTC_MR Mode Register

OffsetNameDescription
0RTC_HRMOD
AT91C_RTC_HRMOD
12-24 hour Mode
0 = 24-hour mode is selected.
1 = 12-hour mode is selected.
All non-significant bits read zero.

RTC: AT91_REG RTC_TIMR Time Register

OffsetNameDescription
6..0RTC_SEC
AT91C_RTC_SEC
Current Second
The range that can be set is 0-59 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
14..8RTC_MIN
AT91C_RTC_MIN
Current Minute
The range that can be set is 0-59 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
20..16RTC_HOUR
AT91C_RTC_HOUR
Current Hour
The range that can be set is 1-12 (BCD) in 12-hour mode or 0-23 (BCD) in 24-hour mode.
22RTC_AMPM
AT91C_RTC_AMPM
Ante Meridiem, Post Meridiem Indicator
This bit is the AM/PM indicator in 12-hour mode.
0 = AM.
1 = PM.
All non-significant bits read zero.

RTC: AT91_REG RTC_CALR Calendar Register

OffsetNameDescription
5..0RTC_CENT
AT91C_RTC_CENT
Current Century
The range that can be set is 19-20 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
15..8RTC_YEAR
AT91C_RTC_YEAR
Current Year
The range that can be set is 00-99 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
20..16RTC_MONTH
AT91C_RTC_MONTH
Current Month
The range that can be set is 01-12 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
23..21RTC_DAY
AT91C_RTC_DAY
Current Day
The range that can be set is 1-7 (BCD).
The significance of the number (which number represents which day) is user defined as it has no effect on the date counter.
29..24RTC_DATE
AT91C_RTC_DATE
Current Date
The range that can be set is 01-31 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.

RTC: AT91_REG RTC_TIMALR Time Alarm Register

OffsetNameDescription
6..0RTC_SEC
AT91C_RTC_SEC
Current Second
The range that can be set is 0-59 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
7RTC_SECEN
AT91C_RTC_SECEN
Second Alarm Enable
0 = The second-matching alarm is disabled.
1 = The second-matching alarm is enabled.
14..8RTC_MIN
AT91C_RTC_MIN
Current Minute
The range that can be set is 0-59 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
15RTC_MINEN
AT91C_RTC_MINEN
Minute Alarm
0 = The minute-matching alarm is disabled.
1 = The minute-matching alarm is enabled.
20..16RTC_HOUR
AT91C_RTC_HOUR
Current Hour
The range that can be set is 1-12 (BCD) in 12-hour mode or 0-23 (BCD) in 24-hour mode.
22RTC_AMPM
AT91C_RTC_AMPM
Ante Meridiem, Post Meridiem Indicator
This bit is the AM/PM indicator in 12-hour mode.
0 = AM.
1 = PM.
All non-significant bits read zero.
23RTC_HOUREN
AT91C_RTC_HOUREN
Current Hour
0 = The hour-matching alarm is disabled.
1 = The hour-matching alarm is enabled.

RTC: AT91_REG RTC_CALALR Calendar Alarm Register

OffsetNameDescription
20..16RTC_MONTH
AT91C_RTC_MONTH
Current Month
The range that can be set is 01-12 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
23RTC_MONTHEN
AT91C_RTC_MONTHEN
Month Alarm Enable
0 = The month-matching alarm is disabled.
1 = The month-matching alarm is enabled.
29..24RTC_DATE
AT91C_RTC_DATE
Current Date
The range that can be set is 01-31 (BCD).
The lowest four bits encode the units. The higher bits encode the tens.
31RTC_DATEEN
AT91C_RTC_DATEEN
Date Alarm Enable
0 = The date-matching alarm is disabled.
1 = The date-matching alarm is enabled.

RTC: AT91_REG RTC_SR Status Register

OffsetNameDescription
0RTC_ACKUPD
AT91C_RTC_ACKUPD
Acknowledge for Update
0 = Time and Calendar registers cannot be updated.
1 = Time and Calendar registers can be updated.
1RTC_ALARM
AT91C_RTC_ALARM
Alarm Flag
0 = No alarm matching condition occurred.
1 = An alarm matching condition has occurred.
2RTC_SECEV
AT91C_RTC_SECEV
Second Event
0 = No second event has occurred since the last clear.
1 = At least one second event has occurred since the last clear.
3RTC_TIMEV
AT91C_RTC_TIMEV
Time Event
0 = No time event has occurred since the last clear.
1 = At least one time event has occurred since the last clear.
The time event is selected in the TIMEVSEL field in RTC_CTRL (Control Register) and can be any one of the following events: minute change, hour change, noon, midnight (day change).
4RTC_CALEV
AT91C_RTC_CALEV
Calendar event
0 = No calendar event has occurred since the last clear.
1 = At least one calendar event has occurred since the last clear.
The calendar event is selected in the CALEVSEL field in RTC_CTRL and can be any one of the following events: week change, month change, year change.s

RTC: AT91_REG RTC_SCCR Status Clear Command Register

OffsetNameDescription
0RTC_ACKUPD
AT91C_RTC_ACKUPD
Acknowledge for Update
0 = Time and Calendar registers cannot be updated.
1 = Time and Calendar registers can be updated.
1RTC_ALARM
AT91C_RTC_ALARM
Alarm Flag
0 = No alarm matching condition occurred.
1 = An alarm matching condition has occurred.
2RTC_SECEV
AT91C_RTC_SECEV
Second Event
0 = No second event has occurred since the last clear.
1 = At least one second event has occurred since the last clear.
3RTC_TIMEV
AT91C_RTC_TIMEV
Time Event
0 = No time event has occurred since the last clear.
1 = At least one time event has occurred since the last clear.
The time event is selected in the TIMEVSEL field in RTC_CTRL (Control Register) and can be any one of the following events: minute change, hour change, noon, midnight (day change).
4RTC_CALEV
AT91C_RTC_CALEV
Calendar event
0 = No calendar event has occurred since the last clear.
1 = At least one calendar event has occurred since the last clear.
The calendar event is selected in the CALEVSEL field in RTC_CTRL and can be any one of the following events: week change, month change, year change.s

RTC: AT91_REG RTC_IER Interrupt Enable Register

OffsetNameDescription
0RTC_ACKUPD
AT91C_RTC_ACKUPD
Acknowledge for Update
0 = Time and Calendar registers cannot be updated.
1 = Time and Calendar registers can be updated.
1RTC_ALARM
AT91C_RTC_ALARM
Alarm Flag
0 = No alarm matching condition occurred.
1 = An alarm matching condition has occurred.
2RTC_SECEV
AT91C_RTC_SECEV
Second Event
0 = No second event has occurred since the last clear.
1 = At least one second event has occurred since the last clear.
3RTC_TIMEV
AT91C_RTC_TIMEV
Time Event
0 = No time event has occurred since the last clear.
1 = At least one time event has occurred since the last clear.
The time event is selected in the TIMEVSEL field in RTC_CTRL (Control Register) and can be any one of the following events: minute change, hour change, noon, midnight (day change).
4RTC_CALEV
AT91C_RTC_CALEV
Calendar event
0 = No calendar event has occurred since the last clear.
1 = At least one calendar event has occurred since the last clear.
The calendar event is selected in the CALEVSEL field in RTC_CTRL and can be any one of the following events: week change, month change, year change.s

RTC: AT91_REG RTC_IDR Interrupt Disable Register

OffsetNameDescription
0RTC_ACKUPD
AT91C_RTC_ACKUPD
Acknowledge for Update
0 = Time and Calendar registers cannot be updated.
1 = Time and Calendar registers can be updated.
1RTC_ALARM
AT91C_RTC_ALARM
Alarm Flag
0 = No alarm matching condition occurred.
1 = An alarm matching condition has occurred.
2RTC_SECEV
AT91C_RTC_SECEV
Second Event
0 = No second event has occurred since the last clear.
1 = At least one second event has occurred since the last clear.
3RTC_TIMEV
AT91C_RTC_TIMEV
Time Event
0 = No time event has occurred since the last clear.
1 = At least one time event has occurred since the last clear.
The time event is selected in the TIMEVSEL field in RTC_CTRL (Control Register) and can be any one of the following events: minute change, hour change, noon, midnight (day change).
4RTC_CALEV
AT91C_RTC_CALEV
Calendar event
0 = No calendar event has occurred since the last clear.
1 = At least one calendar event has occurred since the last clear.
The calendar event is selected in the CALEVSEL field in RTC_CTRL and can be any one of the following events: week change, month change, year change.s

RTC: AT91_REG RTC_IMR Interrupt Mask Register

OffsetNameDescription
0RTC_ACKUPD
AT91C_RTC_ACKUPD
Acknowledge for Update
0 = Time and Calendar registers cannot be updated.
1 = Time and Calendar registers can be updated.
1RTC_ALARM
AT91C_RTC_ALARM
Alarm Flag
0 = No alarm matching condition occurred.
1 = An alarm matching condition has occurred.
2RTC_SECEV
AT91C_RTC_SECEV
Second Event
0 = No second event has occurred since the last clear.
1 = At least one second event has occurred since the last clear.
3RTC_TIMEV
AT91C_RTC_TIMEV
Time Event
0 = No time event has occurred since the last clear.
1 = At least one time event has occurred since the last clear.
The time event is selected in the TIMEVSEL field in RTC_CTRL (Control Register) and can be any one of the following events: minute change, hour change, noon, midnight (day change).
4RTC_CALEV
AT91C_RTC_CALEV
Calendar event
0 = No calendar event has occurred since the last clear.
1 = At least one calendar event has occurred since the last clear.
The calendar event is selected in the CALEVSEL field in RTC_CTRL and can be any one of the following events: week change, month change, year change.s

RTC: AT91_REG RTC_VER Valid Entry Register

OffsetNameDescription
0RTC_NVTIM
AT91C_RTC_NVTIM
Non valid Time
0 = No invalid data has been detected in RTC_TIMR (Time Register).
1 = RTC_TIMR has contained invalid data since it was last programmed.
1RTC_NVCAL
AT91C_RTC_NVCAL
Non valid Calendar
0 = No invalid data has been detected in RTC_CALR (Calendar Register).
1 = RTC_CALR has contained invalid data since it was last programmed.
2RTC_NVTIMALR
AT91C_RTC_NVTIMALR
Non valid time Alarm
0 = No invalid data has been detected in RTC_TIMALR (Time Alarm Register).
1 = RTC_TIMALR has contained invalid data since it was last programmed.
3RTC_NVCALALR
AT91C_RTC_NVCALALR
Nonvalid Calendar Alarm
0 = No invalid data has been detected in RTC_CALALR (Calendar Alarm Register).
1 = RTC_CALALR has contained invalid data since it was last programmed.