PE Labs button - what limits current to pin?
W9GFO
Posts: 4,010
How is the pin protected from too much current when a button is wired like this?
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
The propeller uses Tri-State Logic. When pins are set as inputs, they're not connected to ground, but are in a high-impedance state. No current flows through them - and they determine the voltage level like your voltmeter does.
The pull down resistor keeps the input pin from floating, and keeps you from getting a short circuit when the pushbutton is... pushed.
If you make P18 an output (dira[noparse][[/noparse]18]~~) and connect it to ground (outa[noparse][[/noparse]18]~), you will have a short circuit. BUT, I've done this before without breaking anything - i think there is some protection on the device for this mistake (clamping / esd diodes ?)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed!
Gadget Gangster - Share your Electronic Projects
Wouldn't this be a case where a software error could cause hardware damage and should therefore be avoided?
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
Thanks for asking W9GFO. In addition to the current discussion, your post caused me to notice an error in the schematic. The I/O pin connection symbol is pointing into the pushbutton circuit, indicating that the I/O pin is functioning as an output and transmitting a signal to the circuit. It should be pointing away from the pushbutton circuit to indicate that the I/O pin is an input that's receiving a signal from the circuit.
For BASIC Stamps, it is possible to damage an I/O pin or even the module's interpreter chip by accidentally sending a high signal to ground without a protection resistor. Likewise, sending a low signal to the circuit at the beginning of this post would result in similar damage as soon as the button gets pressed. So, in our Stamps in Class educational textbooks, we almost always put a resistor between the I/O pin and the test circuit. There are some cases where the circuit's performance is adversely affected, and it couldn't damage the I/O pin, so we leave it out. Like with a piezospeaker.
While one of our engineers was working on the Propeller Datasheet, he did some tests where he drove ground with a high signal and 3.3 V with a low signal with no protection resistor and reported no I/O pin damage over 24 hour periods. I'm not sure if this got published anywhere, but that bit of internal news tipped the scales for me on removing the protection resistor. I was already leaning that direction because it's the kind of habit that might save some time and money in prototyping, but those pennies could add up in mass production designs.
I'm definitely open to suggestions for the next revision. Any additional opinions on the pros and cons of including the protection resistor would be greatly appreciated.
Thanks, Andy
P.S. I noticed that I set up the possibility of shorting a high signal to ground in Chapter 7 doing RC decay on a potentiometer. There's a corrected circuit and information posted here:
forums.parallax.com
·· -> Propeller Chip
······ -> Propeller Education Kit Labs, Tools, and Applications
·········· -> Measure Resistance and Capacitance
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.