I stumbled across this webpage where I found this snippet from a PIC forum the author suggests for further reading.
No matter how many times I read this I couldn't make any sense of it. Primarily because the OP and the responder are discussing an input state that is verboten in the digital world. As I see it they're discussing floating an input pin, which can be detrimental to CMOS,.. or at the very least cause extremely erratic behavior.
What say you? Am I misconstruing this thread?
Chris
• -Remove-madygTakeThisOuT at spamexcite.com asks: " the Pic can see a "1" or a "0" however how can a Pic "see" the middle position of a 3 state dip sw?" James Newton replies: Assuming there is a 1k resistor between the switch and the pin, set the pin as an output, pull it low then immediatly switch back to an input and read the value. If it stayed low, repeat the process but pull it high instead. If it stays where you put it, the switch is in the middle.
This is making use of the pins own internal capacitance and would be more reliable with a small cap between the pin and ground. At that point you basically have an RC circuit such as is used in a sigma-delta A to D converter or the POT command used in the BASIC STAMP.+
No matter how many times I read this I couldn't make any sense of it. Primarily because the OP and the responder are discussing an input state that is verboten in the digital world. As I see it they're discussing floating an input pin, which can be detrimental to CMOS,.. or at the very least cause extremely erratic behavior.
What say you? Am I misconstruing this thread?
Chris