Pages: 1 [2]   Go Down
Author Topic: attachInterrupt debounce or Dirty Power supply?  (Read 1013 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, it seems I was wrong about needing the pull down resistor.  If memory serves, I installed the pull down at the same time I cleaned up the power supply, so probably falsely believed I needed it.  The system seems to work exactly the same without it. 

I tried the "now minus then" concept and it helped significantly.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After more testing today, I think I've got it.  It appears that during some "pulses" the signal would have an occassional very fast glitch below the high threshold, and the Arduino was fast enough to see the glitch and count it as a second pulse.  Measuring the length between RISING interrupts didn't solve it because the glitch might occur in the middle of a pulse such that both segments of the pulse were long enough to consider valid pulses.  The solution was to keep track of the time between the last FALLING and the next RISING, so that momentary drops in the pulse could be disregarded.   Just FYI for the curious and a big thanks to all who helped!
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 50
Posts: 2194
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would a cap or a small RC network get rid of the glitch?

Mark
Logged

Pages: 1 [2]   Go Up
Jump to: