cancel
Showing results for 
Search instead for 
Did you mean: 

I have trouble getting low current in stop mode.

sima2
Associate III

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.

2 REPLIES 2
sima2
Associate III

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

sima2
Associate III

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);
}