cancel
Showing results for 
Search instead for 
Did you mean: 

using sleep mode (power saving)

dkilshtein9
Associate II
Posted on December 26, 2012 at 10:24

I'm working on a project where power saving is a critical issue and I need some help with the power mode (sleep).

Here is a short description of the project structure:

Main goals:

Save an image form the camera each second to the SD card

Save value from ADC each second to the SD card

Save as much power as possible

After init, I have three interrupts and three tasks:

Interrupts:

Tick (timer) � for the OS (FreeRtos)

Call the xPortSysTickHandler

DMA transfer for the camera

Clear ISR

Start camera task

ADC complete for the ADC

Clear ISR

Start ADC task

Tasks:

Camera task

Disable the DCMI

Set a flag to indicate that there is a new frame

ADC task

Disable ADC

Set a flag to indicate that there is a new value

Background task

Check the flags to find out if there is any data to save (flags from the two above tasks).

Is so, save to file and readable DCMI and ADC

Set a delay for the background task (vTaskDelay)

The go to sleep

This is how the background task looks like:

while(1)

  {

   

    //check for new data from the camera or ADC

    Background_OP();

        

    //set a small delay for this task

    vTaskDelay(40);

    

    //ZZZ...

    __WFI();

    

  }

}

Everything works fine but I'm not sure about the sleep mode.

Is this the way to use __WFI() function?

Is there a better way to handle power consumption?

#stm32-power-management #low-power
1 REPLY 1
Nickname12657_O
Associate III
Posted on December 26, 2012 at 11:19

Hi Daniel,

To enter the Sleep mode, you can use __WFI or __WFE commands. So what you do should be OK.

Then, to know the better ways to handle power consumption, you can refer to the AN3430 throw this link:

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/DM00033348.pdf

.

It provides some tricks to optimize the power consumption when F2 devices are used.

Let me know if this was helpful for you.

Cheers,

STOne-32