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.

msp430f5659: Internal rtc issue

Part Number: MSP430F5659

hello,

I am using msp430f5659 micro controller. I am interfacing internal rtc module using the example given by ti. My RTCis working correctly but sometimes it stuck in "do while" loop. I did it on different hardware units but i am facing the same problem on all hardware. I am using a crystal of 32.768KHz.

I am using a battery of 3.6v on vbat pin a capacitor of 470nf is connected to vbak pin. Why is this problem arising? please help me to find the solution of the above problem.

     while(BAKCTL & LOCKBAK)                   // Unlock XT1 pins for operation
         BAKCTL &= ~(LOCKBAK);

      UCSCTL6 &= ~(XT1OFF);                     // XT1 On
      UCSCTL6 |= XCAP_3;                        // Internal load cap
    do
      {
        UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
                                                // Clear XT2,XT1,DCO fault flags
        SFRIFG1 &= ~OFIFG;                      // Clear fault flags
      }while (SFRIFG1&OFIFG);                   // Test oscillator fault flag

      RTCCTL01 |= RTCHOLD + RTCBCD ;  // BCD mode, RTC hold, enable RTC read ready interrupt

      RTCYEAR = 0x2017;                         // Year = 0x2011
      RTCMON = 0x10;                            // Month = 0x06 = June
      RTCDAY = 0x30;                            // Day = 0x22 = 22nd
      RTCDOW = 0x05;                            // Day of week = 0x05 = Friday
      RTCHOUR = 0x14;
      // Hour = 0x11
      RTCMIN = 0x10;                            // Minute = 0x59
      RTCSEC = 0x00;                            // Seconds = 0x45

      RTCCTL01 &= ~(RTCHOLD);                   // Start RTC calendar mode

  • Hello Shaifali,

    The oscillator fault flag indicates that the DCO or XT1 is not oscillating properly. VBAT should never surpass 3.6 V, CBAK should be 4.7 nF, CVCORE should be 470 nF, and the CDVCC:CVCORE ratio should be greater than 10:1. Anything not in accordance with these values from the recommended operating conditions from the datasheet is in violation of TI's operation specifications. If you are using internal load caps then external ones are not necessary, although recommended for greater reliability.  More on crystal design: http://www.ti.com/lit/an/slaa322d/slaa322d.pdf 

    Regards,
    Ryan

**Attention** This is a public forum