2021-09-06 04:37 AM
Hi.
I want to use interrupts to wake up from STOP2 and minimize the power consumption.
The internal pull-up of 30k - 50K leaks about 100 uA when pulled to 3V3, so I was wondering how big can be a pull up in order to minimize this consumption. Ideally, placing a 1M resistor would decrease consumption to nanoamps.
I know that it is related to leakage current on the pin (I_lkg), but I don't get it.
Thanks in advance
2021-09-06 09:24 AM
Hi @jsisc.1 ,
the 0.1mA figure you stated is definitely not a normal situation. It means that the external component defaults to GND and by pulling it to 3.3 the maximum possible current goes to the PU resistor.
What is the source of the EXTI interrupt? A button? A sensor? You need to choose the static level with respect to that. The EXTI can detect both rising and falling edge. Then you'll get leakage in nanoamps even with internal PU.
J.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2021-09-06 10:15 AM
Your situation is a little ambiguous.
Is your pin at a high-level until a button is pressed? And the button pulls it to GND? And you're only worried about the leakage current during the time button is pressed? It's a little odd to care so much about this since the current is only flowing when the button is actively pressed, which should be a very small amount of the overall time.
In general, a 1Meg resistor should work okay here. The limiting factor will be the noise in/around the system which could cause a false trigger on this line. You could add a capacitor to mitigate this, just like is done on the NRST pin. Some chips have internal pullups in the ~5 Meg region and they work fine, provided EMF noise is low and/or a capacitor is used.
At very large resistances, you need to worry more about other things like flux residue or other surface imperfection which may provide a lower resistance path.
2021-09-06 11:59 AM
I concur, same concept in I2C : a low level consumes current while a resting high level does not.
2021-09-07 12:13 AM
Thanks for your answers.
The source of the interrupt is the connection/disconnection of another board. See attachment. The line is tied down directly to GND when the board is connected (So the 3V3 voltage falls on the Rpu and produces the 0,1 mA consumption). A falling edge would mean connection and a rising edge, disconnection.
So, the pin is at a high level until a connection is done. Due to the connection can last a lot of time and it is a battery-powered device, I am worried about the consumption through this pin (and I have four in total).
The wire of the external board is about 0.5 meters, so there could be some noise. I will do some tests with 5 Meg resistors with 100 nF ceramic capacitor on the pin to see the behaviour.
Due to big resistors are not cheap, What do you think about this implementation? I can not think of a zero consumption solution without a lot of external circuitry.
Thanks.
2021-09-07 12:37 AM
Hi @jsisc.1 ,
if you are restricted to a single wire then you could also play with the resistor on the external board. If there is a logic on the external board, it can send pulses on the wire, reducing the time it stays low. And if you can spare two wires, you've won. Just connect them on the other side and you're done.
Alternatively, check out the TAMPER feature on the STM32. It's intended as a security feature, but it can easily be configured not to erase anything on detection and only raise an interrupt.
J
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2021-09-07 03:18 AM
It is a ground detect feature. Use an extetnal pull up to reduce the leakage and disable mcu internal one.
2021-09-07 04:10 AM
If you don't need to detect disconnection instantly, then use the internal pullup, but once connected (grounded), switch it off in software and switch in on to test disconnection only rarely and briefly.
Mind the connecting cable's parasitic capacitance.
JW
2021-09-07 06:56 AM
Thanks, JHOUD,
I have no logic on the external board, but I could spare two wires. I don't get you when you say just connect them on the other side. Can you explain the setup?
Regarding tamper, sounds good, but I would need four sources and, as far as I read, there are only three pins for my micro, which is the STM32L4A6
2021-09-07 07:34 AM
Hi @jsisc.1 ,
if you have two wires on the connector, you can create a loop. If the loop is connected, the second board is present, when the board is removed, the two wires are disconnected. But you have control over both, so you can set the level and PU/PD to minimize the consumption in both connected and disconnected states.
J
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.