Shop OBEX P1 Docs P2 Docs Learn Events
Questions regarding current on pins — Parallax Forums

Questions regarding current on pins

johnnycarlosjohnnycarlos Posts: 44
edited 2010-06-16 11:29 in Propeller 1
Hi Folks,

I am trying to determine when and if resistors are required on Propeller chip pins. The description says they can "sink/source 40mA at 3.3 Volts". During output, does that mean the chip can manage its own current and will limit it to 40mA, or do I need to use Ohm's Law to determine a minimum resistor value( 3.3V/.04 A )?

On the input side, what is the purpose of a resistor in parallel to the pins? (see attachment)

Any suggestions appreciated.

Thanks!

John
194 x 214 - 9K

Comments

  • bozobozo Posts: 70
    edited 2010-06-16 03:10
    If the pin is an output, then you should ensure your external circuitry does not place too much load on the pin. That means a resistor, if necessary. But it depends on what circuit you are driving. Ensure that in the worst case, you are not asking the pin to supply more than it can safely handle.

    If the pin is an input, referring to your attached diagram, the resistor is there to pull the pin low when the switch is open. Otherwise the pin is floating and there are no guarantees as to what you will get if you read it (pushbutton open). There may be internal pull up or down resistors in the prop (I don't know) but as a rule it is good practice not to leave it to chance.

    As an aside, it is sometimes a good idea to add a resistor in series with the pin, to limit the current in the event of accidentally misconfiguring the pin as an output.

    Cheers,
    Mark
  • johnnycarlosjohnnycarlos Posts: 44
    edited 2010-06-16 05:39
    That is great information!

    I did some searching on how to determine the base current of a transistor so I could use it as a switch. Here is what I used:

    R1 = Supply Voltage / ( Maximum Current Required / Minimum HFE * 1.3 )

    I put in the proper resistor for that current(which also happened to be less than 40mA) and it works. And the numbers observed on my meter check out perfectly with the calculations. I love it when a plan comes together.

    Thank you.

    John
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-06-16 06:14
    Actually the transistor base resistor must take into account the voltage drop of the base-emitter which is normally around 0.6V. If you had a resistor of around 3K3 you would not get 1ma but 0.818ma instead. If I want 100ma out then I want the transistor to be saturated enough to keep the voltage drop across the collector-emitter as low as possible so as to maximize the voltage to the load and also to minimize the power dissipated by the transistor. So that minimum Hfe * 1.3 doesn't sound right at all.

    The 1.3 may be a fudge factor to over compensate and ensure saturation but then that needs to be more like:
    R1 = (Supply Voltage - 0.6V ) / ( ( Maximum Current Required / Minimum HFE ) * 1.3 )

    So calculating an example:
    R1 = 3.3 - 0.6 / ( ( 100ma / 100 ) * 1.3 )
    R1 = 2.7 / 1.3ma ----> round down to 1K8 at least and I would just use 1K.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • johnnycarlosjohnnycarlos Posts: 44
    edited 2010-06-16 11:29
    @Peter - Yes, I agree. The article I got that from was talking about transistor variability even between transistors the same type. So they put in a 1.3 multiplier to guarantee saturation. I like your formula better as I did not catch the order of precedence. And thanks for pointing the voltage consumed by base-emitter.

    I really appreciate everyone's help.

    John
Sign In or Register to comment.