I'm seeing some strange behavior with digital input that I can't fully explain.
I'm monitoring a PLL lock signal output of some chip using pin 22 on a T3.2. The lock signal is active high and the pin on the board is pulled to ground with 120k resistor. There is also a series 1k in there (which I think is a little high, but I didn't put in there)
// a few lines of relevant code
const int PLL_LOCK = 22;
pinMode(PLL_LOCK, INPUT);
pll_lock = digitalRead(PLL_LOCK);
When the signal PLL lock is is high, and the switch is in position 1, there is about 2.93V on 22. Pin reads HIGH as expected.
However, when I switch to NC (floating input) it drops to only 1.66V... (I triple checked it, and I'm not getting LOW with digitalRead() either) I would think 120k should be more than enough to pull it low, but for whatever reason, that is not happening.
But wait, there is more. If I remove my volt meter's probe and reconnect it, the voltage on 22 drops to 0V, usually on the reconnection. DMM is a Fluke 187. This just doesn't make any sense, unless there is a weak pullup somewhere that's being disturbed, and then switched off.
The fix for this was to add a 150 ohm pull-down to switch position 3, and that works as expected. The PLL lock signal apparently has a very weak drive, that's why only a 120k pull-down. I'll talk to the EEs to replace that 1k with 100 ohm or so, so I can use a smaller pull-down.
But my question still remains, why 120k isn't enough to pull a digital input pin low with no input?
I'm monitoring a PLL lock signal output of some chip using pin 22 on a T3.2. The lock signal is active high and the pin on the board is pulled to ground with 120k resistor. There is also a series 1k in there (which I think is a little high, but I didn't put in there)
// a few lines of relevant code
const int PLL_LOCK = 22;
pinMode(PLL_LOCK, INPUT);
pll_lock = digitalRead(PLL_LOCK);
When the signal PLL lock is is high, and the switch is in position 1, there is about 2.93V on 22. Pin reads HIGH as expected.
However, when I switch to NC (floating input) it drops to only 1.66V... (I triple checked it, and I'm not getting LOW with digitalRead() either) I would think 120k should be more than enough to pull it low, but for whatever reason, that is not happening.
But wait, there is more. If I remove my volt meter's probe and reconnect it, the voltage on 22 drops to 0V, usually on the reconnection. DMM is a Fluke 187. This just doesn't make any sense, unless there is a weak pullup somewhere that's being disturbed, and then switched off.
The fix for this was to add a 150 ohm pull-down to switch position 3, and that works as expected. The PLL lock signal apparently has a very weak drive, that's why only a 120k pull-down. I'll talk to the EEs to replace that 1k with 100 ohm or so, so I can use a smaller pull-down.
But my question still remains, why 120k isn't enough to pull a digital input pin low with no input?