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.

RTC_C interrupt genration issue

Other Parts Discussed in Thread: MSP430F6736

Dear sir,

pl. find below code, we are finding problem in genrating interrupt in RTC_C and pls suggest some solution. I m using controller MSp430F6736.

 

#include "msp430f6736.h"
#include <in430.h>
#include <math.h>


int count = 0;
void main(void)

 WDTCTL = WDTPW | WDTHOLD;

 RTCCTL0_H  =    RTCKEY_H;                      //unlock RTC = 0xA5
    RTCCTL0_L |= RTCRDYIE | RTCTEVIE | RTCOFIE;                              //Enable RTC ready interrupt
    RTCCTL1 |= RTCMODE | RTCHOLD | RTCBCD | RTCSSEL_3;// | RTCTEV_0;                        //RTCRDY, RTC in calendar Mode ,hold RTC before WRITTING any value
 

    RTCDAY = 0X05;
    RTCMON = 0x06;
    RTCYEAR = 0x2015;
    RTCSEC = 0x00;

   RTCCTL1 &= ~RTCHOLD;        // start RTC
 RTCCTL0_L |= RTCRDYIE | RTCTEVIE;                              //Enable RTC ready interrupt
    __bis_SR_register(LPM3_bits | GIE);     // Enter LPM3 w/ interrupts

}

#pragma vector=RTC_VECTOR
__interrupt void RTCISR(void)
{
 count++;
 switch(__even_in_range( RTCIV, 16))
    {
     case RTCIV_RTCRDYIFG:
     {
   while(!(RTCCTL1 & RTCRDY))
   {
    sec = RTCSEC;
      }
        break;
     }
     case RTCIV_RTCTEVIFG :
     {
      __no_operation();
     }
     break;
     case RTCIV_RTCAIFG:                  // RTCAIFG
      __no_operation();                   // Interrupts every alarm event
      break;
      case RTCIV_RT0PSIFG:                // RT0PSIFG
      break;
      case RTCIV_RT1PSIFG:                // RT1PSIFG
      break;
      case 14: break;                     // Reserved
      case 16: break;                     // Reserved
      default: break;
    }
}

 

  • Hi Namrata,

    I tried your code (with modifications to run on F6679A device because this is what I had available) and it runs ok for me. However, I had a couple of questions about your setup:
    1. Do you have a crystal populated on the board, with the proper caps? You must have a 32768Hz crystal on your board for correct RTC_C operation.
    -It might also be good to run some lfxt crystal test code examples on your board as well to see if your crystal is functioning properly without the RTC_C
    2. How to you have AUXVCC3 connected? The crystal is powered by AUXVCC3 on this device because it's part of the backup subsystem. If you use the TI Target board, there should be jumpers that you can set AUXVCC3 connected to DVCC for example, that you could use to make sure your crystal is powered. Please see the user's guide www.ti.com/.../slau208 chapter 4.

    "If AUXVCC3 is not powered by a dedicated supply, it can either be connected to DVCCexternally or powered by enabling the AUXVCC3 charger. If powered by the charger, the recommended capacitor should be connected externally. If AUXVCC3 is not powered or
    connected to DVSS, the backup subsystem (including, for example, the 32-kHz crystal oscillator) is not functional."

    Regards,
    Katie
  • Any update? Did this fix your issue and we can close the thread?
  • hi katie,

    Your solution works for us. In our hardware we had connected AUXVCC3 to DVSS. For RTC it should be connected to DVCC as per your solution. RTC working perfectly but now we are looking towards its storing, that is after power fail RTC get reseted and started with initial configured value. Please let us know if there is solution with you.

    Regards,

    Namrata Sabale.

  • Hi Namrata,

    The RTC will start up at a default value if there is a complete power loss. However, the RTC time can be retained through LPM3.5 mode or from operating off of a backup supply on AUXVCC3. But if you have no alternative supply and truly lose all power completely (no supercap, no backup supply on AUX or anything) then the RTC count is not going to be retained - it's in volatile registers so you at least need a backup supply/cap.

    A really great resource concerning RTC operation with AUXVCC3 and LPM3.5, etc, is this TI Design: www.ti.com/.../tidm-aux-module. Hopefully that can give you some guidance - it demonstrates a number of different possible configurations and scenarios.

    Regards,
    Katie

**Attention** This is a public forum