AnsweredAssumed Answered

Low Power for Interrupt Input Port

Question asked by Peter Simpson on Apr 27, 2018

Hi,

     Would anyone have advice about minimizing power consumption in an input port that generates an interrupt.

      I have a STM32L072 micro with reset switch on Port PB_8 to GND

      I am configuring it with 

      GpioInit( &Switch, SWITCH_PORT, PIN_INPUT, PIN_PUSH_PULL, GPIO_PULLUP, 1 );
      GpioSetInterrupt( &Switch, IRQ_FALLING_EDGE, IRQ_VERY_LOW_PRIORITY, &Switch_IRQ );

      to wake the micro when it is in low power sleep mode

      

      It appears that pull up does not work with the port after it is set as an interrupt so I have had to put a pull up resistor       on the port which I have changed from 10K to 100K without any change.

 

      If the port is configured as an interrupt  as above, in sleep mode it draws 300uA more than if I set to same port still       with the resistor and switch attached using

 

      GPIO_InitStruct.Pin = GPIO_PIN_8; 
      GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
      GPIO_InitStruct.Pull = GPIO_NOPULL;
      GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
      GPIO_InitStruct.Alternate = 0;
      HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

      Any advice on a port configuration that reduces the current would be appreciated

      Thank You

      Regards

Outcomes