Skip to main content
sima2
Associate III
October 11, 2018
Question

I have trouble getting low current in stop mode.

  • October 11, 2018
  • 2 replies
  • 1187 views

I'm using a 32L152C DISCOVERY board.

I have trouble getting really low current in stop mode (< 10µA).

This is the simple code I test with:

int main(void)
{
 PWR_UltraLowPowerCmd(ENABLE);
 
 PWR_FastWakeUpCmd(DISABLE);
 
 // Enters STOP mode
 PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
 
 while(1);
}

I have have removed the jumper from JP1 and connected a current measurement device between JP1.1 to JP1.2 (this measures the current going in to VDD_MCU.

The current is about 4.6mA when entering main() and 1.0 mA in stop mode. Am I doing something wrong?

Just for reference: If I hold down the RESET button the current is 1.2mA.

This topic has been closed for replies.

2 replies

sima2
sima2Author
Associate III
October 15, 2018

Could someone post a short example that is known to give µA current in stop mode?

sima2
sima2Author
Associate III
October 15, 2018

Now I managed to get the current down.

The solution was to set all GPIO to analog mode. I guess this is because the JTAG/SWD pins draws some current when enabled.

Now the current decreased down to 370µA.

But this made the LD3 (green LED) glow faintly.

Somehow the PB7 pin outputs enough current to make it glow faintly. I removed the serial resistor to LD3.

Now the current decreased down to 18µA.

int main(void)
{
 GPIO_InitTypeDef GPIO_InitStructure;
 
 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA | RCC_AHBPeriph_GPIOB | RCC_AHBPeriph_GPIOC | RCC_AHBPeriph_GPIOD, ENABLE);
 
 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;
 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;
 GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
 
 GPIO_Init(GPIOA, &GPIO_InitStructure);
 GPIO_Init(GPIOB, &GPIO_InitStructure);
 GPIO_Init(GPIOC, &GPIO_InitStructure);
 GPIO_Init(GPIOD, &GPIO_InitStructure);
 
 PWR_UltraLowPowerCmd(ENABLE); // This row makes no difference in this simple example
 
 PWR_FastWakeUpCmd(DISABLE); // This row makes no difference in this simple example
 
 // Enters STOP mode
 PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
 
 while(1);
}