RTC_C Operation
724
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
Real-Time Clock C (RTC_C)
RT1PSIFG can be used to generate interrupt intervals selectable by the RT1IP bits. RT1PS is sourced
with the output of RT0PS, which is 128 Hz (32768/256 Hz). Therefore, intervals of 64 Hz, 32 Hz, 16 Hz,
8 Hz, 4 Hz, 2 Hz, 1 Hz, or 0.5 Hz are possible. Setting the RT1PSIE bit enables the interrupt.
NOTE:
Changing RT0IP or RT1IP
Changing the settings of the interrupt interval bits RT0IP or RT1IP while the corresponding
prescaler is running or is stopped in a non-zero state can result in setting the corresponding
interrupt flags.
The RTCOFIFG bit flags the failure of the 32-kHz crystal oscillator. Its main purpose is to wake up the
CPU from LPM3.5 if an oscillator failure occurs. On devices with separate supply for RTC, this flag also
stores a failure event that occurs when the core supply is not available.
NOTE:
Disable the RTC interrupts when changing the V
CORE
level. The process of changing the V
CORE
level disables SYS
H
, and RTC_C is accessible only when SVS
H
is enabled.
29.2.6.1 RTCIV Software Example
The following software example shows the recommended use of RTCIV and the handling overhead. The
RTCIV value is added to the PC to automatically jump to the appropriate routine.
The numbers at the right margin show the necessary CPU cycles for each instruction. The software
overhead for different interrupt sources includes interrupt latency and return-from-interrupt cycles, but not
the task handling itself.
; Interrupt handler for RTC interrupt flags.
RTC_HND
; Interrupt latency
6
ADD
&RTCIV,PC
; Add offset to Jump table
3
RETI
; Vector
0: No interrupt
5
JMP
RTCOFIFG_HND
; Vector
2: RTCOFIFG
2
JMP
RTCRDYIFG_HND
; Vector
4: RTCRDYIFG
2
JMP
RTCTEVIFG_HND
; Vector
6: RTCTEVIFG
2
JMP
RTCAIFG
; Vector
8: RTCAIFG
5
JMP
RT0PSIFG
; Vector
A: RT0PSIFG
5
JMP
RT1PSIFG
; Vector
C: RT1PSIFG
5
RETI
; Vector
E: Reserved
5
RTCOFIFG_HND
; Vector 2: RTCOFIFG Flag
...
; Task starts here
RETI
; Back to main program
5
RTCRDYIFG_HND
; Vector 4: RTCRDYIFG Flag
...
; Task starts here
RETI
; Back to main program
5
RTCTEVIFG_HND
; Vector 6: RTCTEVIFG
...
; Task starts here
RETI
; Back to main program
5
RTCAIFG_HND
; Vector 8: RTCAIFG
...
; Task starts here
RETI
; Back to main program
5
RT0PSIFG_HND
; Vector A: RT0PSIFG
...
; Task starts here
RETI
; Back to main program
5
RT1PSIFG_HND
; Vector C: RT1PSIFG