Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Hazards of sleep mode

Posted by Michael on March 12, 2010
I wrote an an idle hook shown here
void vApplicationIdleHook( void )
P1OUT &= ~0x01;//go to sleep lights off!
LPM3;// LPM Mode - remove to make debug a little easier...

That should cause the LED to turn off, and MSP430 to go to sleep when there is nothing to do. I turn the LED on during some tasks.

I also made sure to modify the sleep mode bit in the SR upon exit of any interrupt that could possibly wake the MCU (with the exception of the scheduler tick isr in port. The macro in iar is
__bic_SR_register_on_exit(LPM3_bits);   // Exit Interrupt as active CPU 

However, it seems as though putting the MCU to sleep causes some irregular behavior. The led stays on always, although when i scope it, it will turn off for a couple instructions cycles when ever i wake the mcu via one of the interrupts (UART).
If I comment out the LPM3 instruction, things go as planned. THe led stays off for most of the time and only comes on when a task is running.

I am using a MSP4f305438

Any ideas?

RE: Hazards of sleep mode

Posted by Richard on March 13, 2010
Maybe not much help - but I seem to recall adding a wake from low power mode into the MPS430 tick handler code some time back (search http://www.freertos.org/History.txt to find the version this first went into). I can't remember which low power mode was used, but I know not all were suitable.


RE: Hazards of sleep mode

Posted by Michael on March 14, 2010
Hey Richard, that thought occurred to me yesterday as well. I am using version 5.4 right now. I will give that a try and post my results when i have something.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo & Nuvoton Cortex-M23 demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner