Quality RTOS & Embedded Software

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




Loading

Hazards of sleep mode

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


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.

Regards.

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.

Thanks,
mike


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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