SPI devices in low power mode - requires pull down resistor on clock line

Thread Starter

freeflyer

Joined Sep 9, 2016
148
I seem to have fixed excessive current draw of some SPI devices when they are in low power modes, but want to validate the reason why.

The SPI devices are controlled by an STM32 which sends power down commands to put the devices into low power mode.

The STM32 also goes into low power mode (standby or shutdown), which means the SPI lines are high impedance.

I managed to fix the excessive current draw of the SPI devices by enabling the STM32 internal pull down resistor on the SPI clock line.

The only thing I can think of is that whilst in a low power mode, any noise on the clock line will cause the device to internally clock and draw additional current.

When the STM32 is in low power mode the clock line is high impedance, so any noise could cause this internal clocking. By pulling the clock line to ground with a resistor, the clock line is no longer floating and prevents internal clocking.

Does this sound like the correct cause and rectification ? Has anyone else experienced this ?

The SPI devices are shown below...


W25Q flash
The W25Q25 flash was drawing about 200 to 300uA after requesting low power mode, but the datasheet states a maximum of 20uA. When I enabled the STM32 internal pull down resistor the W25Q25 current dropped significantly to 4uA.

1771856291403.png


BME280 pressure sensor
The BME280 pressure sensor was drawing about 150to 200uA after requesting low power mode, but the datasheet states a maximum of 0.3uA. When I enabled the STM32 internal pull down resistor the BME20 current dropped significantly to nearly zero.

1771856301057.png
 
Last edited:

Rf300

Joined Apr 18, 2025
72
Bingo!
You measured the effect of CMOS-gates with an open input. CMOS-inputs must always be at a defined level (LOW or HIGH) otherwise something undefined may happen, especially excessive current consumption because the top and the bottom FETs are conducting simultaneously. The output of the STM32 SPI is HIGH-Z, so you have an undefined level at your CMOS-inputs. If you don't want a redesign, activating the internal pulldowns or pullups (at CS) of all SPI outputs (of STM32 and of your SPI-slaves) is a workaround, but the best solution would be adding a dedicated external pullup/-down (10 to 100 kOhm should work) at each line.
 

StefanZe

Joined Nov 6, 2019
212
The pressure sensors probably draws more current because the input is floating when the STM32L433 SCK is high impedance.
A floating input can draw more current because the voltage is between high and low levels
 

Thread Starter

freeflyer

Joined Sep 9, 2016
148
Bingo!
You measured the effect of CMOS-gates with an open input. CMOS-inputs must always be at a defined level (LOW or HIGH) otherwise something undefined may happen, especially excessive current consumption because the top and the bottom FETs are conducting simultaneously. The output of the STM32 SPI is HIGH-Z, so you have an undefined level at your CMOS-inputs. If you don't want a redesign, activating the internal pulldowns or pullups (at CS) of all SPI outputs (of STM32 and of your SPI-slaves) is a workaround, but the best solution would be adding a dedicated external pullup/-down (10 to 100 kOhm should work) at each line.
Glad to hear my thoughts and fix is correct. I was struggling to understand why the current was so high.

I am about to send gerbers to the pcb manufacturer so have the opportunity now to make modifications to the design

Presumably I only need to fit a pull down on the clock line ? Or do I need to do the same with the MOSI and MISO lines too?

Also what value resistor, 100k?

i obviously don’t want it affecting the SPI lines during normal operation.

I am also using I2C devices in low power mode but these have pull up resistors to 3.3V so presumably these aren’t affected?
 

StefanZe

Joined Nov 6, 2019
212
Out of interest, what is the issue with using the STM32 internal pull down resistors?

I dont have space to fit them on the BME280 MISO and MOSI lines but fitted them on all the W25Q lines
Nothing wrong with the internal pull downs.
As stated by joeyd just change the pin mode before entering power down
 

Rf300

Joined Apr 18, 2025
72
Out of interest, what is the issue with using the STM32 internal pull down resistors?

I dont have space to fit them on the BME280 MISO and MOSI lines but fitted them on all the W25Q lines
There is nothing wrong with internal pullups and -downs. I personally prefer external ones because I don't want to rely on SW.
 
Top