cancel
Showing results for 
Search instead for 
Did you mean: 

Do I leak enough current?

GOjayson
Associate

Hello,

I need to know what the minimum required current is to drive a pin as input for the STM32G0-series. I've gone through the datasheet but cannot find anything concluding for me. Could someone tell me?

The reason is that I use a power switch to make headerpins flexible as input/output but when not outputting something it has a small leakage current (between 5-20uA) that could possibly cause false possitives if we want to use a headerpin as input.

if it is too much current how would i fix it best?

 

The resistor arrays are 330Kohm and 51Kohm to change the voltage from 24 to 3.3V

GOjayson_3-1714735297552.png

 

 

 

 

 
2 REPLIES 2
BarryWhit
Senior III

There's a bad-taste joke somewhere in your post title, but I can't find it right now.

I use a power switch to make headerpins flexible as input/output 

Sorry, I can't make out what you mean by that. I don't see any power switch in your schematic, and I'm not sure what the circuit you're describing is. Can you provide more details about what you're doing?

 

At the risk of embarrassing myself (prematurely), what does current have to do with it? If you put a very small current source in series with a capacitor to ground, will that capacitor charge over time or won't it? If switching on a FET is like charging a tiny capacitor (or a respectable capacitance, if it's a power FET), wouldn't you expect the FET gate to switch eventually, if you source//sink even a tiny current to it?

 

Your "leakage current" is really due to the large but finite resistance of the switch in the open position, isn't it? (*) - Fine,

but what is the nature of the source/sink which is leaking *through* the switch? If it's a voltage source above Vinh (or for that matter a ground which can sink current from a pin in High state), I would expect that yes, this could result in GPIO inputs switching.

 

But I'm not super confident I'm not missing something,  and would be glad to have someone set me straight. If they have a luxurious grey beard, that would be even better.

 

(*) On second thought, it could also be capacitively-coupled high-frequency noise, instead of DC.

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.
Techn
Senior II

You can connect a resistor in series to the sensor tied to vcc or ground , so that the input to the mcu will be low or high as needed.  When you operate the swich, the input polarity changes,  so that the mcu can detect it. The resistor should be small enough that the voltage developed with your leakage current don't cause any false trigger, it has nothing to do with micro input leakage current.  If you keep high value such as mega ohms, with your leakage current the input to mcu will be false and switching will not change. Keep the resistor low to allow leakage current to ground it, but high enough not to load your switch beyond its current source capacity.