I have 2 digital inputs configured on a T4.1. Each has a 10k external pullup. I have been finding in my full build and code that I am getting occasional instances where when only one input is closed, both routines fire. I built up a bare PCB with only the T4.1 and the inputs/pullups and had the same issue, so then tried a third T4.1 connected to the most basic pullup circuit on a breadboard and had a look at what was happening with a scope.
I don't know a lot about electronics, but if I just tap the digital input pin with a pair of tweezers, I see BOTH inputs momentarily (much less than a microsecond) drop low enough to be considered a state change. The code IS running on the board but as you can see, it shouldn't change the behaviour here.. Admittedly they are adjacent pins, but is this expected behaviour?
pinMode(22, INPUT); // sets the digital pin as input for START beam
pinMode(23, INPUT); // sets the digital pin as input for FINISH beam
..
attachInterrupt(22, isrStartBeam, FALLING); // interrupt on light beam input
attachInterrupt(23, isrFinBeam, FALLING); // interrupt on light beam input
Is there anything I can do in the code to dampen the sensitivity of the digital inputs? Will adding a small cap across each input help/fix? Most importantly though - is this expected behaviour or am I doing something wrong?
When I look at the output from the code, I can see both interrupt routines running when I tap the signal line on either one. It's NOT all the time, and me+tweezers or, me using an unplugged multimeter lead to tap the pin both trigger the issue about 75% of the time...
What am I missing?
Cheers - Neil G
I have tried 4.7k and 2k resistors instead, and I have tried with the internal pullups enabled as well. It occurs to me I have NOT tried with ONLY the internal pullups... but something feels odd here.
I don't know a lot about electronics, but if I just tap the digital input pin with a pair of tweezers, I see BOTH inputs momentarily (much less than a microsecond) drop low enough to be considered a state change. The code IS running on the board but as you can see, it shouldn't change the behaviour here.. Admittedly they are adjacent pins, but is this expected behaviour?
pinMode(22, INPUT); // sets the digital pin as input for START beam
pinMode(23, INPUT); // sets the digital pin as input for FINISH beam
..
attachInterrupt(22, isrStartBeam, FALLING); // interrupt on light beam input
attachInterrupt(23, isrFinBeam, FALLING); // interrupt on light beam input
Is there anything I can do in the code to dampen the sensitivity of the digital inputs? Will adding a small cap across each input help/fix? Most importantly though - is this expected behaviour or am I doing something wrong?
When I look at the output from the code, I can see both interrupt routines running when I tap the signal line on either one. It's NOT all the time, and me+tweezers or, me using an unplugged multimeter lead to tap the pin both trigger the issue about 75% of the time...
What am I missing?
Cheers - Neil G
I have tried 4.7k and 2k resistors instead, and I have tried with the internal pullups enabled as well. It occurs to me I have NOT tried with ONLY the internal pullups... but something feels odd here.
Last edited: