Having GPIO's Pull-up not changing transistor's state

Thread Starter

alphacat

Joined Jun 6, 2009
186
Hi.

During reset, the Uc I wanna use sets its GPIOs to input with pull-up resistor.

One of the GPIOs sets the state of a transistor - ON or OFF - as can be seen in the picture below.

After reset, I set this GPIO to Output LOW, however, i'm afraid that during reset the transistor will be ON (reset occurs by a push button, so reset-mode can last more than just a breif moment).

How can I prevent the transistor from turning on during reset?
I'm looking for a low cost and simple solution.
(Can it be done by resistors only?).

Thank you.

 

Attachments

BMorse

Joined Sep 26, 2009
2,675
If the uc sets the GPIO to an input during reset, this should not have any affect on the transistor state as long as it has the pulldown resistor as shown, since when the GPIO is in input mode, it does not output anything to change the state of the transistor...

B. Morse
 

Thread Starter

alphacat

Joined Jun 6, 2009
186
Hi B. Morse.
Thanks for the help.

I dont understand why a pulled-up input GPIO doesnt source any current if its connected to a close circuit (I mean, voltage + close circuit = current).

V_BASE = R2 / (R2 + R1) * V_GPIO

In my case:
R1 = 4.7KΩ, R2 = 47KΩ, V_GPIO(HIGH) = 3.3V
So, VBASE is well above 0.7V.
Why wouldnt it turn ON then?
 

BMorse

Joined Sep 26, 2009
2,675
Hi B. Morse.
Thanks for the help.

I dont understand why a pulled-up input GPIO doesnt source any current if its connected to a close circuit (I mean, voltage + close circuit = current).

V_BASE = R2 / (R2 + R1) * V_GPIO

In my case:
R1 = 4.7KΩ, R2 = 47KΩ, V_GPIO(HIGH) = 3.3V
So, VBASE is well above 0.7V.
Why wouldnt it turn ON then?

Because the GPIO is set as an INPUT not an output, it will not source or sink current. If it was set to an OUTPUT pin when the uc resets, then it could turn the transistor on.

What microcontroller are you thinking of using?? This will help to better understand your concerns....

B. Morse
 

Thread Starter

alphacat

Joined Jun 6, 2009
186
Hi again, and thanks.

I wanna use an 8051 Uc.

Could you tell about the structure of the input pin?
I can't imagine how it doesnt change the BJT's state.
 

BMorse

Joined Sep 26, 2009
2,675
Hi again, and thanks.

I wanna use an 8051 Uc.

Could you tell about the structure of the input pin?
I can't imagine how it doesnt change the BJT's state.

You should have been more specific about the device you planned on using, an 8051 WILL source current when a pin is defined as an input due to the internal pullups.... I would suggest using a pnp instead of an npn to alleviate this issue.


B. Morse
 

Thread Starter

alphacat

Joined Jun 6, 2009
186
Hi, thanks again.

I understand your suggestion, it'd be a good solution.

Is it possible to somehow solve it by resistors?
 
Top