Shop OBEX P1 Docs P2 Docs Learn Events
Interesting problem on P4 of Quickstart — Parallax Forums

Interesting problem on P4 of Quickstart

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.

Comments

  • ErNaErNa Posts: 1,752
    Did you measure resistance of the pin to ground in an unpowered state?
  • P0-7 have sometimes given me trouble on the Quickstart because they are attached to the touch buttons.
  • @David: I saw that in the schematic. Looks like they have a 100K to the open side of the pads and then your finger completes that to ground. It wouldn't seem to account for that kind of sustained current draw. I considered that though, because I have also seen problems with those in high static areas. My desk at work freaks those out sometimes.


    @ErNa: I'll check that tonight. That would be a good test to see if it's something in hardware.
  • Well the resistance check indicates nothing out of the ordinary. Something like 15.5 MegaOhms which is the same as the other pins. So this seems to call my program into question again. I may put a blank program on it and try the input test again. If this problem doesn't happen while the board is powered and in a do-nothing loop that will be a strong indication it's somewhere in my code.



    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.
  • kwinnkwinn Posts: 8,697
    photomankc wrote: »
    Well the resistance check indicates nothing out of the ordinary. Something like 15.5 MegaOhms which is the same as the other pins. So this seems to call my program into question again. I may put a blank program on it and try the input test again. If this problem doesn't happen while the board is powered and in a do-nothing loop that will be a strong indication it's somewhere in my code.



    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 Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2016-01-15 20:28
    I would triple-check your program, especially since you have multiple cogs. Disable those cogs one at a time, and see if the problem goes away. Better still, enter a very simple program that just tests the pin and does nothing else. IMO, your symptoms point to a software issue.

    -Phil
  • That's where I'm heading. Something somewhere made that an output pin. Going to be a blast to track it down now. So it sounds like the Prop actually can survive a direct I/O contention issue, at least briefly. Impressive.
Sign In or Register to comment.