This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am working with the onboard RTC of MSP430FR4133 Launchpad. I have to make a clock and alarm system . I referred the code below which makes the RTC in a counter mode. It also says that RTC is triggered by a SMCLK.
#include <msp430.h> int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P4SEL0 |= BIT1 | BIT2; // set XT1 pin as second function do { CSCTL7 &= ~(XT1OFFG | DCOFFG); // Clear XT1 and DCO fault flag SFRIFG1 &= ~OFIFG; }while (SFRIFG1 & OFIFG); // Test oscillator fault flag P1OUT &= ~BIT0; // Clear P1.0 output latch for a defined power-on state P1DIR |= BIT0; // Set P1.0 to output direction PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode // to activate previously configured port settings // Initialize RTC // RTC count re-load compare value at 32. // 1024/32768 * 32 = 1 sec. RTCMOD = 32-1; // Source = 32kHz crystal, divided by 1024 RTCCTL = RTCSS__XT1CLK | RTCSR | RTCPS__1024 | RTCIE; __bis_SR_register(LPM3_bits | GIE); // Enter LPM3, enable interrupt } // RTC interrupt service routine #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=RTC_VECTOR __interrupt void RTC_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(RTC_VECTOR))) RTC_ISR (void) #else #error Compiler not supported! #endif { switch(__even_in_range(RTCIV,RTCIV_RTCIF)) { case RTCIV_NONE: break; // No interrupt case RTCIV_RTCIF: // RTC Overflow P1OUT ^= BIT0; break; default: break; } }
My question is
1. Is there any AUXVCC3 pin , where I can connect 3.0 battery like CR2032 , and be able to count the time elapsed when the Launchpads power is taken off. ?
2. Another thing is , if there is such AUCVCC3 pin, I can only monitor RTCCNT count for knowing the time elapsed ? I wish to know the framework of such approach. Would like to try it out
**Attention** This is a public forum