Part Number: MSP430F5659
Hi Team,
I'm using MSP430F5659 in my product, I'm getting updated date and time while main power is available(Coin cell battery also connected to VBat) there is no issue.
But whenever i turned off main power that time i'm not getting updated date and time. I'm getting before main power off time and date.
Below are the settings for RTC-B
void Initialize_RTC_B(void)
{
/ / Unlock battery backup system
while(BattBak_unlockBackupSubSystem(BAK_BATT_BASE));
// Initializes the LFXT1 crystal oscillator in low frequency mode
UCS_turnOnLFXT1(UCS_XT1_DRIVE_3,UCS_XCAP_3);
/* 1-0 RTCTEVx RW 0h Real-time clock time interrupt event
00b = Minute changed
01b = Hour changed
10b = Every day at midnight (00:00)
11b = Every day at noon (12:00) */
//Specify an interrupt to assert every minute
RTC_B_setCalendarEvent(RTC_B_BASE,
RTC_B_CALENDAREVENT_MINUTECHANGE);
//Enable interrupt for RTC Ready Status, which asserts when the RTC
//Calendar registers are ready to read.
//Also, enable interrupts for the Calendar alarm and Calendar event.
RTC_B_clearInterrupt(RTC_B_BASE,
RTCRDYIFG + RTCTEVIFG + RTCAIFG);
RTC_B_enableInterrupt(RTC_B_BASE,
RTCRDYIE + RTCTEVIE + RTCAIE);
//Start RTC Clock
RTC_B_startClock(RTC_B_BASE);
// interrupts enabled
__bis_SR_register(GIE);
__no_operation();
}
//******************************************************************************
//
//This is the RTC_B interrupt vector service routine.
//
//******************************************************************************
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=RTC_VECTOR
__interrupt
#elif defined(__GNUC__)
__attribute__((interrupt(RTC_VECTOR)))
#endif
void RTC_B_ISR(void)
{
// Unlock backup system
while(BattBak_unlockBackupSubSystem(BAK_BATT_BASE));
switch(__even_in_range(RTCIV,16))
{
case 0: break; //No interrupts
case 2: //RTCRDYIFG
break;
case 4: //RTCEVIFG
//Interrupts every minute
__no_operation();
//Read out New Time a Minute Later BREAKPOINT HERE
RTC_B_getCalendarTime(RTC_B_BASE);
break;
case 6: //RTCAIFG
//Interrupts 5:00pm on 5th day of week
__no_operation();
break;
case 8: break; //RT0PSIFG
case 10: break; //RT1PSIFG
case 12: break; //Reserved
case 14: break; //Reserved
case 16: break; //Reserved
default: break;
}
}
Did I miss something?
