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

Discussion in 'Embedded Systems and Microcontrollers' started by alphacat, Mar 30, 2010.

  1. alphacat

    Thread Starter Active Member

    Jun 6, 2009
    186
    0
    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.

    [​IMG]
     
  2. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    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
     
  3. alphacat

    Thread Starter Active Member

    Jun 6, 2009
    186
    0
    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?
     
  4. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Does the emitter go to ground?
     
  5. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    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
     
  6. alphacat

    Thread Starter Active Member

    Jun 6, 2009
    186
    0
    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.
     
  7. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    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
     
  8. alphacat

    Thread Starter Active Member

    Jun 6, 2009
    186
    0
    Hi, thanks again.

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

    Is it possible to somehow solve it by resistors?
     
Loading...