IO-Pin as Output set to low direct connection to Vdd = big current ? Value of C
StefanL38
Posts: 2,292
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
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
Have a look at this link.
http://forums.parallax.com/showthread.php?p=733913
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
Post Edited (Mike Green) : 7/3/2008 1:58:29 PM GMT
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
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.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Post Edited (Leon) : 7/3/2008 3:45:58 PM GMT
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.
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