The reason I ask is I've been having some trouble with some of my pins and think I may have dorked a few pins. I am testing some micropython code that scans some input pins. I have connected the output GPIO pins in the code to another set of input GPIO pins. For example I first declare pins 0, 1, 2 as outputs then declare pins 3, 4,5 as inputs with pull down. I have various testing configurations of connecting 0 -> 3, 1 -> 4, 2 -> 5 and other combinations between the 3 and scanning the inputs. These connections are made before powering up the board.
It seemed to work a few times but then started having issues. Using the logic analyzer I would notice by setting pin 2 high that pin 5 which is not even connected to anything at the time would also go high.
So is it good practice to declare input pins first? And is it good practice to have a resistor in-between the output and input pins maybe something like 470 ohm?
I think I know the answer but wanted to hear from the crowd on the subject.
It seemed to work a few times but then started having issues. Using the logic analyzer I would notice by setting pin 2 high that pin 5 which is not even connected to anything at the time would also go high.
So is it good practice to declare input pins first? And is it good practice to have a resistor in-between the output and input pins maybe something like 470 ohm?
I think I know the answer but wanted to hear from the crowd on the subject.
Statistics: Posted by donmerch — Sun Sep 01, 2024 2:25 pm — Replies 2 — Views 53