Shop OBEX P1 Docs P2 Docs Learn Events
IO-Pin as Output set to low direct connection to Vdd = big current ? Value of C — Parallax Forums

IO-Pin as Output set to low direct connection to Vdd = big current ? Value of C

StefanL38StefanL38 Posts: 2,292
edited 2008-07-03 18:57 in Propeller 1
Hello,

i don't want to destroy my IO-Pins so i'm asking this:

What happens if an IO-Pin is set as Output and state is set to low.
now the IO-Pin is connected directly to +Vdd. I guess i big current will flow. Is this right ?

If an IO-Pin is set as Output and state is set to high and connected directly to ground i'm sure
there will flow a big current destroying the IO-Pin.

What value would you take for a current-limiting resistor ?

Espescially in the case of a switch with a pull-down-resistor as shown in

robot.tmcp.com.au/buildingblock/guides/switch_1.htm

The current-limiting-resistor will cause a voltagedrop making the voltage
on the IO-Pin lower. What value could be used for the current-limiting-resistor
to limit the current as much as possible concerning the high-state should be still clearly high ?

As some propellerusers seem to be not familiar with basic electronics has any propeller-related
website something written about this VERY basic things about electronics ?

best regards

Stefan

Post Edited (StefanL38) : 7/3/2008 10:16:23 AM GMT

Comments

  • PraxisPraxis Posts: 333
    edited 2008-07-03 10:22
    Hi StefanL38,

    Have a look at this link.


    http://forums.parallax.com/showthread.php?p=733913
  • LeonLeon Posts: 7,620
    edited 2008-07-03 10:51
    That's the reason why MCUs generally have their pins configured as inputs when they are reset. It's not a good idea to connect pins to Vss or Vdd.

    Simply use Ohm's Law to calculate the value of the current-limiting resistor.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 7/3/2008 11:14:21 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-03 13:52
    The Propeller is unusually robust. During the testing for developing the datasheet information, I/O pins were shorted to ground (Vss) and the output state set to high and left that way. It didn't seem to damage the Propeller. The output transistor's maximum current is set by the chip area used and is less than what it would take to destroy it. That said, the Propeller's I/O pins have a specified maximum current (40mA) and this needs to be respected. A good starting point for a series resistor to protect from short circuits would be 100 Ohms. If you're also trying to protect from exposure to voltages outside of the 0-3.3V range, a 1K Ohm resistor would be needed. There are protective diodes to Vss and Vdd on the chip and they can't tolerate the same current if you accidentally connect an I/O pin to, say, 5V.

    Post Edited (Mike Green) : 7/3/2008 1:58:29 PM GMT
  • LeonLeon Posts: 7,620
    edited 2008-07-03 14:58
    Max. output current is actually 30 mA per I/O.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-03 15:14
    Leon,
    Check the datasheet on page 25. The maximum allowable current per I/O pin is 40mA. There's also a total chip current of 300mA.
  • LeonLeon Posts: 7,620
    edited 2008-07-03 15:36
    My copy (1.01) of the manual says 30 mA in the spec. on page 16. I just checked the data sheet and that says 40 mA. Parallax ought to sort out their Propeller documentation, there are several inconsistencies which I find rather confusing.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 7/3/2008 3:45:58 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-03 15:46
    The latest version of the datasheet on Parallax's website is version 1.0 which is what I quoted from.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-07-03 17:25
    The manual was created before the datasheet so the values provided in the datasheet are from simulation models. The datasheet should be considered the authoritative source for such things. The reason the manual hasn't been changed is that since it is a published book it must be updated less frequently otherwise we would be constantly be caught with obsolete stock.

    Something that gets missed when the 40mA is quoted is that it's the absolute maximum rating, this does not mean the Propeller is capable of putting out logic signals at those high currents. In fact a pin sourcing 40mA of current will have an output voltage of ~1.85V and a pin sinking 40mA of current will be ~2V. Note that the "logic high" is producing a voltage slightly less than "logic low", iow it's no longer behaving like an ordinary logic output. Many CMOS logic devices state thier Vil and Vih to be 30% and 70% of Vdd respectively. For a 3.3V device that's 0.99V for Vil and 2.31V for Vih. For the Propeller to output voltages which adhere to this requirement, the current traveling through the pin must be less than 30mA. And in practice it should be limited to 25mA or less to ensure enough margin for the signal to always be recognized correctly (Otherwise you may end up with a design that works at room temperature but stops working when you have it outside on a summer's day).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-07-03 18:57
    Hello Paul, Mike and Leon,

    thank you very much for your answers. I think now i can start building it.
    To make the application save against wrong Output-definition i think it would be good to add
    a current-limiting-resistor

    As Paul mentioned above for a 500mV peak to peak noise the margin should be minimum ±400mV.


    This would mean for a 3,3V supplyvoltage
    Low-Level 0V-1,2V (1,6V-0,4V)
    High-Level 2,0V-3,3V (1,6V + 0,4V)

    A current-limiting resistor of 470 Ohms combined with a 4700 Ohm PullDOWN-resistor
    IO-Pin accidently set as Output and set to logical low the current would be
    3,3V / 470 Ohm = 7 mA.

    If IO-PIN is set correctly as Input the voltagedrop across the 470 Ohm is

    3,3V / ( 470 Ohm + 4700 Ohm) * 470 Ohm = 0,3V. Voltage on the IO-Pin 3,3V - 0,3V = 3,0V
    secure detected as logical high. Even with quite a lot noise on the IO-Pin.

    So that's what i wanted to know.

    best regards

    Stefan
Sign In or Register to comment.