5
\$\begingroup\$

I've got a project where I'm trying to get the power consumption down as low as possible (on an STM32F103RCT6).

I looked at ST's document on getting the STM32F2 power consumption down as low as possible, and tried to follow its recommendations:

  • Setting all unused pins to AIN
  • Turn off the ADCs
  • Turn off USB
  • Using PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFE); to go into STOP mode while being able to wake up with EXTI

Thing is, power draw is still 4.6mA (down from 15 in standard _WFI sleep, and around 30 when actually doing stuff). The datasheets seem to suggest that power consumption in STOP should be under 0.5mA.

I've put a scope on the external oscillator and that does indeed stop.

Is there anything obvious I'm missing? Is there any way for me to check what could be causing the extra power draw?

UPDATE: I've come up with a very simple test program, derived from ST's example code:

#include "stm32f10x.h"

GPIO_InitTypeDef GPIO_InitStructure;


int main(void)
{
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |
                         RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD |
                         RCC_APB2Periph_GPIOE, ENABLE);

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
  GPIO_Init(GPIOA, &GPIO_InitStructure);
  GPIO_Init(GPIOB, &GPIO_InitStructure);
  GPIO_Init(GPIOC, &GPIO_InitStructure);
  GPIO_Init(GPIOD, &GPIO_InitStructure);
  GPIO_Init(GPIOE, &GPIO_InitStructure);

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |
                         RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD |
                         RCC_APB2Periph_GPIOE, DISABLE);  

  RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE);

  while (1) PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
}

Power draw with this is still 4.3mA. I've checked the circuit too - it's REALLY basic and I've measured the voltage across every resistor (and it's zero).

Any ideas? I'm currently thinking that it's actually the LD1117 voltage regulator that's at fault!

\$\endgroup\$
  • 1
    \$\begingroup\$ Are the internal oscillators active? Do you have any pullup/pulldown resistors on the board which have a voltage across them in this mode? Do you have any off-board interfaces (SWD debugger, serial, usb, etc) connected which could be drawing (or donating!) power through the signal lines ? And its always worth another read through the docs for something you could have missed. \$\endgroup\$ – Chris Stratton Aug 16 '13 at 13:47
  • 1
    \$\begingroup\$ Have you had a look in the firmware library? There is usually an example of low power modes in there IIRC. Try standby mode too, as it looks as though that is the lowest consumption mode according the the reference manual (though you should still see <1mA in stop mode). \$\endgroup\$ – Oli Glaser Aug 16 '13 at 16:42
  • 1
    \$\begingroup\$ I would guess that this could be a hardware issue from you circuit around the controller, and not the controller itself. I was thinking the same as @ChrisStratton on pullups/downs. Also, where and how do you measure? What is connected to AIN other than the unused pins? \$\endgroup\$ – chwi Aug 21 '13 at 7:45
  • \$\begingroup\$ Hi. Thanks for the help - and sorry for the delay getting back to you - I've been a bit busy. I'll try and look into this properly. I'm unsure about the internal oscillators - how would I check? There are some pull-ups/pull-downs - I thought I had checked these but I'll go through more methodically. I had followed the low power example, but the software on the device is a lot more complex than that. I'll maybe try with just the example code and see if that manages to lower the power consumption. \$\endgroup\$ – Gordon Williams Aug 21 '13 at 13:52
  • 1
    \$\begingroup\$ In case someone wants to find the document about STM32F2 power consumption, it is called AN3430. \$\endgroup\$ – Étienne Jul 14 '14 at 13:18
5
\$\begingroup\$

Wilhelmsen and Chris were right - it was the circuit.

However, it wasn't resistors, external IO, etc. It was the LD1117 Voltage Regulator which I hadn't really considered before.

It turns out that pretty much all the 1A, 3.3v LDO voltage regulators I can find have a 5mA quiescent current. I've just soldered in a MIC5205 (which is rated for 150mA) and it now draws 0.12mA! \o/

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.