Interesting problem on P4 of Quickstart
photomankc
Posts: 943
in Propeller 1
So I was working on a project involving a set of inputs on the Quickstart board (P1-P4) and was banging my head on the desk with this problem. When a pulled-up high (3.3V) signal was attached to P4 and the input sampled there was "0". The same signal applied to other input pins resulted in a "1" value but not on P4. Thinking I had done the worst I checked that it was not an output for some reason and nothing in the code indicates that. So I preceded to attach that signal to other pins and they all returned "1" as expected. This only seemed to happen on P4.
So I connected P4 directly to 3.3V supply, a little risky I know. Now the P4 input value flipped to "1". Thinking that was really odd I pulled out my meter and put it in current mode. The pin while indicating a "1" value was pulling 43mA from the supply line... "that's not good" I said and pulled the wires! So when attached to a signal that included a pull-up resistor it was actually dropping the voltage at the pin to a few millivolts... I think like 0.012V. Swapping out the 10K pull-up for a 1K raised that voltage to around 0.1V which seems to confirm that that pin is loaded despite being an input.
This project involves multiple cogs and I did review and re-review the code to make sure I didn't accidentally set that pin as an output in another cog but I don't see that happening in the code. If I change the pins to avoid P4, everything works fine. And anyway, honestly I thought that if an output was set to "0" and connected to 3.3V that would result in a dead-short through the I/O pin and destroy the pin, not raise the voltage to 3.3V and make the input register read "1".
Any ideas on what the failure mode might be here? There is nothing to the circuit. It's a Quickstart board and a few switches to ground with pull-ups on the input pin side of the switch.
So I connected P4 directly to 3.3V supply, a little risky I know. Now the P4 input value flipped to "1". Thinking that was really odd I pulled out my meter and put it in current mode. The pin while indicating a "1" value was pulling 43mA from the supply line... "that's not good" I said and pulled the wires! So when attached to a signal that included a pull-up resistor it was actually dropping the voltage at the pin to a few millivolts... I think like 0.012V. Swapping out the 10K pull-up for a 1K raised that voltage to around 0.1V which seems to confirm that that pin is loaded despite being an input.
This project involves multiple cogs and I did review and re-review the code to make sure I didn't accidentally set that pin as an output in another cog but I don't see that happening in the code. If I change the pins to avoid P4, everything works fine. And anyway, honestly I thought that if an output was set to "0" and connected to 3.3V that would result in a dead-short through the I/O pin and destroy the pin, not raise the voltage to 3.3V and make the input register read "1".
Any ideas on what the failure mode might be here? There is nothing to the circuit. It's a Quickstart board and a few switches to ground with pull-ups on the input pin side of the switch.
Comments
@ErNa: I'll check that tonight. That would be a good test to see if it's something in hardware.
Still I'm surprised that if it's an output set to "0" and an input at supply "1" that there isn't more than 44mA of current being drawn. I would think that would be off-scale until destruction of the pin internals. That current suggests something like 75Ohms of resistance, way more than I would expect the pin to have on it's own.
That current actually sounds reasonable. IIRC the output mosfets resistance was in the neighborhood of 40 ohms. The high resistance reading could result from the voltage out from the multimeter being less than the forward voltage of a diode. There are diodes on the output pins. Try using the diode setting on the meter and measure pin to gnd and pin to Vcc twice, and reverse the meter leads for the second measurement.
BTW, if all you are changing is the pin number and the software works on other pins but not p4 the software is not at fault.
-Phil