cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to disable GPIO?

vicki19880929
Associate III
Posted on October 09, 2013 at 21:15

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.  :D

Shan
2 REPLIES 2
Posted on October 09, 2013 at 21:32

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Amel NASRI
ST Employee
Posted on October 24, 2013 at 14:49

Hi Shan,

You find more tips on how to achieve the lowest current consumption with STM32F2xx in the

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00033348.pdf

 and the associated

http://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.