2013-10-09 12:15 PM
Hi all,
Recently I'm trying to implement some power saving code. In some condition (e.g. a specific digital input pin is ON), I'd like to enable all of my GPIO pins, while in the rest of the time I'd like to disable it. Is there any good ways that I can do? I'm also using ADC/DAC/DMA as well.I looked into the gpio library, but I'm not quite sure if GPIO_DeInit() could fulfill my goal. Seems like it only set all the pins to default settings (i.e. input floating mode) and it still consumes power.I'm pretty new to the power saving issue. I'd be very appreciated if anyone could help. :DShan2013-10-09 12:32 PM
You can remove the clocking, this will hold pins in a static state.
ST recommends programming the pins in Analogue Input mode, as this also turns off the Digital Input side Schmitt Trigger. Consider also what you are driving externally, like LED, line drivers, back lights, etc. Turn off other peripherals (external to the STM32). Consider if driving a pin to zero is a better option, this might be preferable if undriven pin oscillates. Evaluate how your system actually behaves, and where the current is consumed. Use WFI over grinding in tight loops.2013-10-24 05:49 AM
Hi Shan,
You find more tips on how to achieve the lowest current consumption with STM32F2xx in the and the associatedhttp://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/PF257894
. If you are using another product, some tips may still applicable. -Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.