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.

MSP430F5635: Not able to write to RTC_B's seconds, hours, minutes registers

Hi,

Was unable to write to RTC_B registers. 

Tried checking the oscillator fault flags. The oscillator fault flag for XT1 is always set.

I tried resetting it by software, but it comes back again.

What can be the issue?

This is the code

 UCSCTL6 |= XCAP_3;
//// Initialize LFXT1
UCSCTL6 &= ~(XT1OFF);                   // Enable XT1
UCSCTL6 &= ~XT1DRIVE0;
UCSCTL6 &= ~XT1DRIVE1;
//UCSCTL6 |= XT1BYPASS;
UCSCTL4 &= 0x0000;
 
do
{
    UCSCTL7 &= ~(XT2OFFG | XT1LFOFFG | DCOFFG);
    // Clear XT2,XT1,DCO fault flags
   SFRIFG1 &= ~OFIFG;                   // Clear fault flags
} while (SFRIFG1 & OFIFG); 
 
 
RTCCTL01 = (/*RTCBCD +*/  RTCTEV_0 + RTCTEVIE);// + RTCRDYIE);  // enable minute time interrupt and when minute time interrupt happens enable RTCDYIE to read the date
 RTCCTL01 = RTCBCD + RTCHOLD ;
 //RTCCTL01 |=  RTCHOLD;
// set_rtc_time(YEAR, JULY, DATE, WEDNESDAY, HOUR, MINUTE, SECOND);
 RTCSEC = 0x00; // Set Seconds
 RTCMIN = 0x00; // Set Minutes
 RTCHOUR = 0x08; // Set Hours
 RTCDOW = 0x02; // Set DOW
 RTCDAY = 0x12; // Set Day
 RTCMON = 0x12; // Set Month
 RTCYEAR = 0x2015; // Set Year
 RTCCTL01 &= ~RTCHOLD; // Enable RTC

Thanks

Sangeeta

**Attention** This is a public forum