Shop OBEX P1 Docs P2 Docs Learn Events
Need help understanding outputs — Parallax Forums

Need help understanding outputs

Steven.S.Steven.S. Posts: 4
edited 2008-04-28 11:07 in General Discussion
Hello again,
···· I've spent hours trying to figure out how to get the SX28 chip to send an output current to the base of my BJT. In my code I set RB.7 to an output then I ran it. I expected to get Vdd coming out of that pin, but nope nothing. confused.gif Im using PortB since portC is taken up by a keypad and Im using RA.0 to control my LCD.

·

Comments

  • Steven.S.Steven.S. Posts: 4
    edited 2008-04-26 09:21
    Ok, I've figured out how to output Vdd. But, I wanted to know how to get the 30mA to come out of an output pin
  • BeanBean Posts: 8,129
    edited 2008-04-26 13:34
    You need to put a resistor in series with the output pin.
    Use a 150 ohm resistor.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
  • John CoutureJohn Couture Posts: 370
    edited 2008-04-27 21:26
    Steven, Bean came up with that "magic" number by:

    Ohms law says that Voltage = Current times Resistance, or V=IR where V=Voltage, I=Current (in amps) and R=Resistance (in ohms)

    To solve for resistance (because you know voltage and current), you would use R=V/I.

    Thus:

    30ma = 0.030 Amps

    R = 5 / 0.030 = 166.7

    The closest resistance value (and allowing for resistors that are not all that close to their published values) would probably be 150 ohms.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • BeanBean Posts: 8,129
    edited 2008-04-28 11:07
    John,
    Yes, I should have explained how I got 150 ohms.
    I was actually accounting for the 0.6 volt drop in the BJT.
    So I used (5.0 - 0.6) / 0.030 = 146.66 Ohms.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
Sign In or Register to comment.