Why am I having a problem with an input pin on my Due?

Hello all. I have a Due and I was using Pin 22 as an input. I did make sure to set the pinMode in the setup block. I actually had the system working. I have a physical pull down resistor (meaning I don't mess with the internal ones) with a value of 10k to pull the pin low. I then have a pushbutton that will send 3.3V high when pressed. It is pretty simple and it was working. However, something changed recently. Now, the pin shows high all the time. As a test, I removed the pushbutton and literally just have a 10k resistor to ground and it still shows high. The ONLY way I can get it to go low is if I directly short it to ground with no resistor. Then and only then it will show a low. As a test, I also tried setting the digitalWrite for that pin to LOW just after I setup the pinMode to INPUT. Just wanted to see if the internal pull ups were messing with me. No luck there either.

What is odd is if I move to any other pin, it works just fine. Meaning, the pull down resistor to ground will bring the pin low. Granted, I could just move to another input pin and move on. BUT, I want to know what happened and how to prevent it. Is it possible that I shorted that input? How could that have happened with a pushbutton hooked to 3.3v? Is there a possible issue during startup that I must pay attention to? In other words, while the board is starting up, what if 3.3v is applied to an input pin before you have a change to set it as an INPUT?

What can I do to prevent or protect an input pin to make this more forgiving? I saw a post where somebody put a small (100 ohm) resistor in series with the input pin to prevent a short. Or, should I look at opto-isolation?

Sorry, I know that was alot.


neat, is this the exact same post as on General Electronics ? Microcontrollers ?

No-one has a chance of helping you if you don't post your code...

If it doesn't pull down to 0V with a blank sketch, then the pin is electrically damaged. Perhaps it inadvertently touched something connected to the neighbouring 5V positions on the connector