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.

Deep Sleep timer

Other Parts Discussed in Thread: MSP430F2274, CC2500

Hello,

I am working on a school project and I would like to implement a power saving 'deep sleep' mode. I've read through some other threads, but I am not quite getting how to have implement a deep sleep mode with a wake up timer. Is there information on this application?

-Thanks in advanced!

  • I've found this demo for CCS at http://processors.wiki.ti.com/index.php?title=EZ430-RF2500#eZ430-RF2500_Deep_Sleep. Unfortunately, I am using IAR, but I think this is a good start for anyone.

  • There are many different ways, depending on the device you use.

    On 1x, 2x and 4x family, you can only disable the CPU and the DCO etc. But the device needs to stay 'on' otherwise.
    You can rout a 32768Hz crystal to a timer and get an interrupt (a wakeup) every 2 seconds, or (if additional dividers are used) up to 16 seconds.

    On 5x family, you have more options. You can use the VLO, a very low power oscillator with an unknown frequency in the range of 4 to 20 kHz. No crystal required then. Also, larger dividers are possible. You can also use the watchdog instead of a timer and achieve delays up to days.
    Alternatively, on some 5x family MSPs there is an RTC. You can set the device into low power mode but leave the crystal running and program the RTC to trigger an alarm at a certain date/time. On devices with separate backup supply, it is even possible to completely deactivate the device except for the RTC, so the alaem will boot the device from scratch, while in the meantime no power is required for things like ram retention.

    It really depends on what exactly you want to do and with which MSP.

  • What msp430 are you using?
    Do you have a 32K crystal attached OR using 1mhz DCO only?

    Do you need to wake up on a pin state change or on a fixed time interval?

    With 32K crystal it is easy to go in to deep LMP3 sleep for 1 minute at a time.

  • in msp430 clock system is very flexible
    you have from 5 to 7 low power modes
    you can use external and internal clock sources

    so like tony wrote you should give us more details
    now we will be could give you some advices

  • I am using the ez430 development kit. That uses a msp430f2274. I am not using any external crystal. At this point I am doing a fixed time interval. I've read that using the internal VLO has the best sleep state. Is that correct?

  • VLO is a resistor-cap oscillator and they are have wide range from 4-to-20khz rate (typical 12khz)

    Yes it can be used for very low power deep sleep, but only if you don't care that it can be 10 or 18 seconds
    before you wake maincode up.

    You can get a little more accuracy if you use calibrated 1mhz dco to measure how many ticks the VLO does
    in one second and use that number of ticks for the VLO 1sec timer, and once an hour you do the calibration again.

  • I can have the accuracy +/-10% of the wake up time. Will the VLO clock work in this case? Also, is there a maximum limit the VLO can keep the state at sleep mode. Lastly, where would I find information of how to code with VLO deep sleep mode. I've found some results with the VLO timer in the CC2500 data sheet but it wasn't very helpful.

  • I've found out that you can put the mote to sleep with the built in low power modes. Low power mode 4 is what I've learn to be the lowest. However, I am not sure how to wake it up. Here is the basic structure of what I am doing.

    while(1){

     __bis_SR_register(LPM4_bits);//deep sleep

    __delay_cycles(24000);// wait for a while

    _bis_SR_register(~LPM4_bits); wake up

    //do main loop

    }

  • Isaac Puckett said:
    I am not sure how to wake it up

    __bis_SR_register intrinsic will set the LPM bits in the status register. At this point, the CPU stops and won’t continue. If an interrupt occurs and interrupts are enabled, the CPU starts again, executes the ISR and after returining from ISR, stops again. You’ll need to set the GIE bit too: __bis_SR_register(LPM4_bits|GIE);

     To wake up, the ISR must clear the LPM bits on the SR register copy stored on stack. There are special intrinsic available like __bic_SR_register_on_exit(LPM4_bits) (not adding GIE here leaves interrupts enabled).
    If this is executed, the main execution will continue once the ISR exits. Note that any crystals require time to come up again and oscillator faults are flagged (and ALCK/SMCLK may have fallen to failsafe-backup mode)

  • Thank you for your help. You have stated that the timers/crystals will not operate when in LPM4. If this is the case, how can I have an interrupt happen without manually doing it? I would prefer to use a timer, but it seems like I can only do it on LMP3. Is this correct?

  • LPM3 is barely sipping power and a battery will last years.
    LMP4 is nearly zero power, a batteries self-discharge is probably higher.

    So why are you needing 4?
    I think 4 can only wake up from a few special pins changing state.

  • I measured the current draw on LPM3 and it was 2mA. That's good, but for the application that I am trying to do would work better if it took slightly less current. Would an external crystal be a good option for a wake up interrupt?

  • LMP3 uses 1uA or less.

    So it's other things on your PCB that is using power.
    remove any debugger cable while testing power usage, as backflow in to programmer could happen.


    Or you spend very little time in LMP3 mode less than 1%, and going to LMP4 will not help you.

  • In LPM4, clocks are off. But MODOSC for ADC is still running, port pin interrupts are active and timer in capture mode (even though the timer itself might be stopped) will be active. And I2C slave or SPI slave will still be active and trigger interrupts.
    So even without any active clock, there are still lots of sources for interrupts.

     About current, well, 2mA is way more than the MSP draws even if everything is active. So the current comes from (or rather goes to) something external. If a port pin is high with external load, then it will of course draw current, no matter in which low power mode you are. Also, if input pins are floating, this may cause pin oscillations and therefore current consumption (yet normally not in the mA range).

  • Thanks for your help. I understand that the bulk of the power must be coming from elsewhere on my board. However, my board is naked and the only thing else that is running in the CC2500. I put the radio to sleep before I go to sleep. I have it set to come out of sleep every second. I see the variation of the current draw when I set out a burst message. Is the current coming from how I put my radio to sleep? I used this command to do so.

    SMPL_Ioctl(IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SLEEP, 0); //Radio to sleep mode

  • Since this is now a radio issue I have moved this to a more appropriate forum located at http://e2e.ti.com/support/wireless_connectivity/f/964/t/352155.aspx

**Attention** This is a public forum