NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

StarterWare RTC

From Texas Instruments Wiki
Jump to: navigation, search
{{#switchcategory:MSP430=<McuHitboxHeader/>|C2000=<McuHitboxHeader/>|Stellaris=<McuHitboxHeader/>|TMS570=<McuHitboxHeader/>|MCU=<McuHitboxHeader/>|MAVRK=<MAVRKHitboxHeader/>|<HitboxHeader/>}}

Introduction[edit]

The RTC peripheral provides a time reference to applications running on the device. The current date and time is tracked in a set of counter registers that update once per second. The time can be represented in 12- or 24-hour mode (i.e. 1:00 p.m. or 13:00). The calendar and time registers are buffered during reads and writes so that updates do not interfere with the accuracy of the time and date. Alarms are available to interrupt the CPU at a particular time or at periodic time intervals, such as once per minute or once per day. In addition, the RTC can generate CPU interrupts whenever the calendar or time registers are updated, or at programmable periodic intervals. The StarterWare APIs to configure and operate the RTC peripheral are listed in include/rtc.h.

Programming[edit]

The following guidelines and general procedure should be observed when programming the RTC peripheral.

  • Configure the overall system clocks and the functional clocks for RTC. Apply appropriate Pin Multiplexing if required.
  • Out of reset, RTC registers are write-protected. To disable this write-protection and to program the RTC registers, specific key values have to be programmed to the KICK registers (KICK0 and KICK1). Use the RTCWriteProtectDisable() API to do this.
  • Call the RTC32KClkSourceSelect() API passing appropriate parameters to select either internal clock source or external clock source for providing the 32KHz clock input to the RTC.
  • Call the RTC32KClkClockControl() API passing appropriate arguments to enable RTC to receive clock inputs from the previously selected clock source.
  • Call the RTCEnable() API to enable the RTC. This ensures that the 32KHz clock input to the RTC is not gated.
  • Use RTCTimeSet() to set the specified time in the relevant RTC registers. The time is passed as a parameter to this function. This function sets the second, minute, hour and the meridiem (AM or PM) values in the relevant registers. There are also APIs to set these values individually.
  • Call the RTCRun() API immediately after calling RTCTimeSet() to start clock operation (i.e. "ticks").
  • Use RTCCalendarSet() to set the specified calendar information in the relevant RTC registers. The calendar information is passed as a parameter to this function. This function sets the day (of the week and of the month), month, and year values in the relevant registers. There are also APIs to set these values individually.
  • Call RTCTimeGet() and RTCCalendarGet() to read the current time and calendar information respectively from the relevant registers.
  • The user can also enable interrupts to be generated when specific events occur. Use RTCIntTimerEnable() API to enable periodic generation of interrupts. The period between two periodic interrupts could be a second, a minute, an hour or a day.
  • RTC peripheral can also generate interrupts when it reaches a certain time and calendar reading. These are called alarm interrupts, and they are enabled using the RTCIntAlarmEnable() API. The alarm time is written to the alarm registers of the RTC.


Note: Text in blue refers to configuration steps applicable to RTC IPs in the following SoCs.

  • AM335x.
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare RTC here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare RTC here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article StarterWare RTC here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article StarterWare RTC here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article StarterWare RTC here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare RTC here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare RTC here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article StarterWare RTC here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article StarterWare RTC here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity

{{#switchcategory:MSP430=<McuHitboxFooter/>|C2000=<McuHitboxFooter/>|Stellaris=<McuHitboxFooter/>|TMS570=<McuHitboxFooter/>|MCU=<McuHitboxFooter/>|MAVRK=<MAVRKHitboxFooter/>|<HitboxFooter/>}}