• Resolved

MSP430FR6989: HOW TO RUN REAL TIME CLOCK CONTINUOUSLY EVEN IN POWER OFF

Prodigy 145 points

Replies: 12

Views: 414

Part Number: MSP430FR6989

HOW TO ENTER INTO LPM3 MODE WHEN POWER OFF

  • IT MEAN THAT NOT BIS INSTRUCTION
    WHAT IS THE CONDITION TO ENTER IN LPM MODE
  • In reply to hanumantha rao:

    Hi, Hanumantha,

    The "Power Off" you mentioned in the question means no power supply for DVCC of FR6989?

    Regards,
    Lixin
  • In reply to Lixin Chen1:

    Hi, Hanumantha,

    FR6989 cannot work when no power supply on DVCC, including entering in low mode modes.

    If the DVCC is in specification, FR6989 can enter into LPM3 mode with following condition:
    1) CPU and MCLK are disabled;
    2) ACLK is active, SMCLK is disabled.
    This means there is peripheral working with ACLK as clock source. But there is no peripherals requesting SMCLK for clock source.
    If there is any peripheral requesting SMCLK as clock source, the LPM3 cannot be entered in.

    Hope my answer can help you.

    Regards,
    Lixin
  • In reply to Lixin Chen1:

    #include "driverlib.h"
    #include <stdint.h>

    Calendar currentTime;

    char TIME[10],DATE[12];
    char SEC_OK ;
    uint16_t PWROFF,MNTH,YER;

    int main(void)
    {
    WDT_A_hold(WDT_A_BASE);
    PMM_unlockLPM5();
    INIT_PORTS();
    INIT_CLOCKS();
    LCD_INIT();
    INIT_ADC();

    if (SYSRSTIV == SYSRSTIV_LPM5WU)
    {
    RTC_C_clearInterrupt(RTC_C_BASE, RTC_C_CLOCK_READ_READY_INTERRUPT|RTC_C_OSCILLATOR_FAULT_INTERRUPT);
    RTC_C_enableInterrupt(RTC_C_BASE,RTC_C_CLOCK_READ_READY_INTERRUPT|RTC_C_OSCILLATOR_FAULT_INTERRUPT);
    RTC_C_startClock(RTC_C_BASE);
    }


    SET_TIME_AND_ALRM();

    __bis_SR_register(GIE);


    SEC_OK = 0;
    PWROFF = 0;
    while(1)
    {
    if(PWROFF ==0)
    {
    if(SEC_OK == 1)
    {
    //ADC MEASURES THE INPUT
    currentTime = RTC_C_getCalendarTime(RTC_C_BASE);
    }
    }
    else
    {
    __bis_SR_register(LPM3_bits | GIE);

    }
    }
    }

    #pragma vector=RTC_VECTOR
    __interrupt void RTC_ISR(void)
    {
    switch(__even_in_range(RTCIV, 16))
    {
    case RTCIV_NONE: break; //No interrupts
    case RTCIV_RTCOFIFG: break; //RTCOFIFG
    case RTCIV_RTCRDYIFG: //RTCRDYIFG
    SEC_OK = 1;
    break;
    case RTCIV_RTCTEVIFG: //RTCEVIFG
    //Interrupts every minute
    __no_operation();
    break;
    case RTCIV_RTCAIFG: //RTCAIFG
    __no_operation();
    break;
    case RTCIV_RT0PSIFG:
    __bic_SR_register_on_exit(LPM3_bits);
    break; //RT0PSIFG
    case RTCIV_RT1PSIFG:
    __bic_SR_register_on_exit(LPM3_bits);
    break; //RT1PSIFG

    default: break;
    }
    }

    #pragma vector=PORT1_VECTOR
    __interrupt void RTC_INTIAL(void)
    {


    if(GPIO_getInterruptStatus(GPIO_PORT_P1, GPIO_PIN1))
    {
    GPIO_clearInterrupt(GPIO_PORT_P1, GPIO_PIN2);

    PWROFF = 1;
    }


    if(GPIO_getInterruptStatus(GPIO_PORT_P1, GPIO_PIN1))
    {
    GPIO_clearInterrupt(GPIO_PORT_P1, GPIO_PIN2);
    __bic_SR_register_on_exit(LPM3_bits); 
    }

    }

    FROM ABOVE I HAD GIVEN A BATTERY BACKUP WITH A DIODE TO DVCC

    AND A CIRCUIT WHICH TRIGGERS THE P1.1 WHEN POWER ON AND P1.2 WHEN POWER OFF

    MY QUESTION IS WHEN I PRESS A RESET BUTTON RTC REGISTERS BECOMES RESET  THAT IS RTC IS NOT CONTINUING TO RUN FROM PREVIOUS 

  • In reply to hanumantha rao:

    Hi, Hunamantha,

    RESET button press will reset the MCU and the RTC registers will be reset. This is the normal behavior. I am wondering why you request RTC continuing to run after pressing RESET button.
    Could you describe the function you need for the circuit? The external circuit can trigger the interrupt for P1.1 and P1.2 and switch the DVCC power supply from main power to the backup battery? I need to understand your design and provide comments then.

    Regards,
    Lixin
  • In reply to Lixin Chen1:

    my application is
    RTC SHOULD RUN CONTINOUSLY

    1. my msp430 has DVCC PIN which is powerd by two supplies one is battery and another one is stepdown supply
    both are given with the help of diodes
    2. when there is no stepdown supply the MSP SHOULD BE RESET BUT RTC SHOULD RUN CONTINIOUSLY
  • In reply to hanumantha rao:

    The confusion here is what you mean by "MSP should be reset". The RTC, being a part of the "MSP" is reset along with the rest of the "MSP" under normal reset conditions.

    I think you need to implement some sort of "warm start" that senses when the power switches from battery backup to the stepdown supply and sets the state accordingly.
  • In reply to Keith Barkley:

    you are saying that once suply is intiated after program dump
    reset should not occur
  • In reply to hanumantha rao:

    No, you can reset all you want. I am saying that there is no way to separate out the RTC reset from the rest of the MCU resetting.
  • In reply to Keith Barkley:

    if stepdown supply is off when loop is in adc samples then their is a battery discharge
    how can we over come this