Skip to main content
Explorer
March 5, 2025
Solved

Enter and exit standby mode using single button

  • March 5, 2025
  • 1 reply
  • 549 views

Hello,

 

I am using STM32L073RBT6 controller. I want to use standby mode in my battery operated instrument. I want to use single tactile button to enter and exit standby mode. Is it possible to do?? 

What if I allocate another nearby pin as GPIO interrupt and short it to SYSTEM_WAKEUP pin and use it to enter in the standby mode?

Thank you so much in advance for the help. 

Have a great day ahead!

    This topic has been closed for replies.
    Best answer by Saket_Om

    Hello @JeetS 

    You can configure a GPIO pin to detect the button press and use it to trigger the MCU to enter standby mode. Set up the GPIO pin to detect the button press and generate an interrupt. This interrupt can be used to execute the code that puts the MCU into standby mode.

    The STM32L073RBT6 can be woken up from standby mode using a wake-up pin (e.g., PA0, which is WKUP1).  Please refer to the device datasheet

    Saket_Om_0-1741170932928.png

    Please refer to the Projects/32L0538DISCOVERY/Examples/PWR/PWR_STANDBY to learn how to enter and exist standby mode using wake-up pin.

    It is possible to use the same pin to enter and exit standby mode, however it should be one of the three wake up pins mentioned in the datasheet (PE6, PC13, PA0).


    @JeetS wrote:

    What if I allocate another nearby pin as GPIO interrupt and short it to SYSTEM_WAKEUP pin and use it to enter in the standby mode?


    It can work; you should test the solution. 
     

    1 reply

    Saket_OmAnswer
    Technical Moderator
    March 5, 2025

    Hello @JeetS 

    You can configure a GPIO pin to detect the button press and use it to trigger the MCU to enter standby mode. Set up the GPIO pin to detect the button press and generate an interrupt. This interrupt can be used to execute the code that puts the MCU into standby mode.

    The STM32L073RBT6 can be woken up from standby mode using a wake-up pin (e.g., PA0, which is WKUP1).  Please refer to the device datasheet

    Saket_Om_0-1741170932928.png

    Please refer to the Projects/32L0538DISCOVERY/Examples/PWR/PWR_STANDBY to learn how to enter and exist standby mode using wake-up pin.

    It is possible to use the same pin to enter and exit standby mode, however it should be one of the three wake up pins mentioned in the datasheet (PE6, PC13, PA0).


    @JeetS wrote:

    What if I allocate another nearby pin as GPIO interrupt and short it to SYSTEM_WAKEUP pin and use it to enter in the standby mode?


    It can work; you should test the solution.