cancel
Showing results for 
Search instead for 
Did you mean: 

Auto WakeUp due to floating of wakeup pins?

JKSah
Associate II

We are trying to build MCU application that require wakeup from standby mode using wakeup pins. MCU we are using STM32L412KB and it consists of 2 wakeup pins on PA0 and PA2.

As per figure 3 we want to connect PA2 wakeup pin to USB V sense to wakeup usb on plugging it in but we faced following issue on connecting a button on PA0 wakeup pin:

As per figure 1 we tried connecting PA0 wake pin to button. But in this configuration MCU was able to wake up automatically without button press.

So we checked the NUCLEOL412RB-P board schematic and we found out that there was some extra circuitry on the user button, we added the same circuitry on the button in our circuit as shown in figure 2. And it worked flawlessly.

So I want to know what is the purpose of this circuit in the nucleo board? And should we use this circuit at the USB V sense pin in order to avoid automatic wakeup of MCU or not?

6 REPLIES 6
MM..1
Chief II

You dont need this circuit on button, but need enable internal pulldown, or use external . On USB you have it, then changes isnt necessary.

As wakeup pin gets rising or falling edge(depending upon configuration) it wakes up the MCU. When we configure pins as wakeup in STMCubeMX it doesnt support internal pull up/down as it is only available when pin is configured as GPIO input/output, I guess we need to add external pulldown. But can you explain why this circuit is needed or what is the purpose of this circuit?

Also what do you mean by "On USB you have it, then changes isnt necessary"? In our schematic we have just connected PA2 pin to USB port connecter's V sense pin so I guess its floating and doesnt have any pull up or pull downs.

Vsense have 15k to ground then is pull down... float is only Vbus

and on discovery is pins connected to more places , when is used for other purposes for example out and anybody press button 1k protect it against kill...

TDK
Guru

> So I want to know what is the purpose of this circuit in the nucleo board?

The point is to make the signal less prone to noise by adding an RC circuit and to add an external pulldown so the level is 0 when the button is not pressed. That's the important part that is missing from your circuit.

You can enable a pullup or pulldown when in low power mode via the PWR_PUCRx/PWR_PDCRx registers.

> And should we use this circuit at the USB V sense pin in order to avoid automatic wakeup of MCU or not?

It has a pulldown via the resistor divider network which should be enough. You could add a small cap to mitigate noise if you find it is an issue.

If you feel a post has answered your question, please click "Accept as Solution".
JKSah
Associate II

Deleted

JKSah
Associate II

Can you please suggest what exact value 100nF/100pF/10pF of capacitor shall we use ​to mitigate this noise ?