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.

low power mode (LPM4)

Other Parts Discussed in Thread: MSP430F5152

Hi,

I am using msp430F5152 for my project and iam using lpm4 in application and using comparator to  wake up form lp mode.

here is my problem,  After going to LPmode not waking up properly, waking up only aftr giving 3.3v and then ground to comparator pin CB6.

I have configured the comparator to rising edge trigger and falling edge, same result for both. I want it to work immidiatly after giving 3.3 v to the pin.Dont know how to go abt it, little help would be appreciated. 

Thanks in advance ,

Anand

 

  • Well, maybe you misconfigured the comparator, maybe you have a hardwar eproblem, maybe... any othe rof the gazillion of reasons why something might fail.

    There is no generally known 'comparator won't wake MSP from LPM4' bug, and since this is the only information you provided for your problem, there is no solution to offer.

    You should post your code, describe your hardware connections etc.

    CB6 is on PJ0, which means, this is a JTAG programming pin. Do you have the FET attached? maybe you're fighting the JTAG signals?

  • From your description, I have to conclude that either one or more of the following is/are true:

    (1) MSP430F5152 has one or more previously unknown bug.

    (2) The particular chip you use is defective.

    (3) You misunderstood the functions of that chip.

    (4) Your code did not do what you intend to do.

    (5) You are kidding us.

  • WDTCTL = WDTPW | WDTHOLD;                 // Stop WDT

           UCSCTL4 = SELA_1;                       // Ensure VLO is ACLK source

           // Port Configuration

             P1OUT = 0x00;

             P2OUT = 0x00;

             P3OUT = 0x00;

             PJOUT = 0x00;

             P1DIR = 0xFF;

             P2DIR = 0xFF;

             P3DIR = 0xFF;

             PJDIR = 0xFF;

             PMMCTL0_H = PMMPW_H;                    // PMM Password

             SVSMHCTL &= ~(SVMHE | SVSHE);           // Disable High side SVS

             SVSMLCTL &= ~(SVMLE | SVSLE);           // Disable Low side SVS

                __bis_SR_register(LPM4_bits);             // Enter LPM4

    }
    Above code I used for going to LPM4 mode and the below code is used to wake up from the LPM4
    void Init_Comparator (void)                                   Comparator configuration
    {
    // Setup ComparatorB
    CBCTL0 |= CBIPEN + CBIPSEL_6;            // Enable V+, input channel CB6 //CBIPSEL_6
    CBCTL1 |= CBPWRMD_1;                           // normal power mode
    CBCTL2 |= CBRSEL;                                    // VREF is applied to -terminal
    CBCTL2 |= CBRS_3+CBREFL_1 ;             // R-ladder off; bandgap ref voltage (2.5V)// anand changed  CBREFL_3
    CBCTL3 |= BIT0;                                             // Input Buffer Disable @P1.0/CB0
    __delay_cycles(7500);                                  // delay for the reference to settle
    CBINT &= ~(CBIFG + CBIIFG);                    // Clear any errant interrupts
    CBINT  |= CBIE;                                             // Enable CompB Interrupt on rising edge of CBIFG (CBIES=0)
    CBCTL1 |= CBON;                                        // Turn On ComparatorB
    }
    #pragma vector=COMP_B_VECTOR          Comparator interrrupt vector for wake up
    __interrupt void Comp_B_ISR (void)
    {
    __bic_SR_register_on_exit(LPM4_bits + GIE);  // Exit LPM4 on return to main

    LED_ON;       // indication wakeup
    __delay_cycles(7500);
    __delay_cycles(7500);
    TD0CCTL1 = TD1CCTL1 = OUTMOD_0;
    TD0CCTL2 = TD1CCTL2 = OUTMOD_0;
    Duty = 60;
    TD0CCR1 = TD1CCR1 = Duty;
    TD0CCR2 = TD1CCR2 = Duty - 20;
    CBCTL1&= ~(CBIES);
    //CBCTL1|= CBIES;                 // Anand added    tryed with different mode 
    //CBCTL1 ^= CBIES;              // Toggles interrupt edge
    WDTCTL = 0xDEAD;
    CBINT &= ~CBIFG;                // Clear Interrupt flag
     lpmode=0;
    }
    The controller is waking up form the LPM4, but the way it is waking up is not proper, ie  the comparator pin is not taking HIGH (3.3V) or LOW (GND) at first, it wakes up by 

    only this fashion  " FIRST CONNECT TO THE 3.3V (HIGH ) THEN TO LOW ". I want it to wakeup immediately pin given to 3.3v.


    It seems some problem from my side,  some guidance highly appreciated.
    Thanks in advance 
  • It could be a good idea to call init_Comparator() before entering LPM.
    And another good idea is to not fall out of main into the void after you finally managed to wake up.

**Attention** This is a public forum