cancel
Showing results for 
Search instead for 
Did you mean: 

GPIOs in low power when a defined output is required ?

Andrew Neil
Super User

I know that, for lowest power, it's recommended to switch GPIOs to analogue in.

But I require outputs to keep a defined level during low-power (STOP).

As far as an STM32F030 is concerned, is there any power consumption advantage to choose between using push-pull and open-drain (possibly with pull-up/down) ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
2 REPLIES 2
waclawek.jan
Super User

I believe that as far as power consumption (except what's drawn/pushed by the external circuitry from/to the GPIO pins in question) there's no difference between pushpull (with no pullup/pulldown), open drain (where pullup would be switched on only when output is NOT set to 0) and Input with pullup or pulldown as appropriate.

This, assuming that the nominally 40k pullup/pulldown is sufficient to supply whatever external current is to be drawn.

JW

Andrew Neil
Super User

Sidekick says:

Push-Pull vs. Open-Drain in STOP Mode

While the documentation does not provide a direct comparison between push-pull and open-drain configurations in STOP mode, it emphasizes that push-pull is generally preferred for maintaining a defined output level with minimal consumption. Open-drain may be used in specific cases, but it typically requires an external pull-up resistor, which could increase power consumption depending on the resistor value and the state of the pin.

 

It references Tips for using STM32 low-power modes, which does say:

Perhaps in one situation where a device connected to a GPIO is still on when the GPIO is set to analog mode, this could leave the pin in floating state and cause toggling on the other device. In this situation, it may be better to leave the GPIO in a known push-pull state, which has minimal consumption to begin with. Consider all external connections when deciding which configuration is best

But gives no discussion of justification of push-pull vs open-drain or using internal pullups.

 

Also AN4899 GPIO software guidelines for power optimization, but that also doesn't seem to consider the choice between push-pull vs open-drain or using internal pullups.

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.