Hello everyone,
I connected a comparator output to an MCU external interrupt pin. One threshold crossing should generate a single interrupt, but sometimes multiple interrupts occur from one event.
The input signal has some noise near the threshold.
Questions:
Would comparator hysteresis be the correct hardware fix?
Should I also debounce the interrupt in firmware?
On the PCB side, should comparator reference traces be isolated from noisy digital return currents?
External Interrupt Triggers Multiple Times from One Event
-
lichurbagan
- Posts: 59
- Joined: Thu Nov 13, 2025 3:20 pm
Re: External Interrupt Triggers Multiple Times from One Event
Yes, it will fix thigns ... what’s happening here is:Would comparator hysteresis be the correct hardware fix?
Input hovers around the threshold
Noise causes the comparator to toggle rapidly
MCU sees multiple edges .... so multiple interrupts
Adding hysteresis (positive feedback) creates two thresholds .... One for rising .... One for falling .... This prevents chatter and ensures one clean transition per event.
Yes ... its recommended but dont rely on it ocmpletely .... Firmware debounce (time filtering or ignore window) helps catch any residual glitches .... But it should not be the only solution .... check this discussion, you will get it: https://www.reddit.com/r/AskElectronics ... ebouncing/Should I also debounce the interrupt in firmware?
So, Fix in hardware (hysteresis) first .... Then add firmware filtering for robustness
Yes .... very important .... Comparator reference and input nodes are sensitive .... so keep them away from digital switching currents and return pathsOn the PCB side, should comparator reference traces be isolated from noisy digital return currents?
Use a clean ground reference (analog ground region if possible) .... I normally prefer seperate gnd and power planes .... depends on the complexity of yoru pcb but if its multilayer .... sepearte clean planes saves from a lot of trouble .... check these guides: https://www.aivon.com/blog/pcb-design/t ... -circuits/ https://www.pcbway.com/blog/Engineering ... lanes.html
Avoid sharing return paths with high-current or fast-switching signals
Keep traces short and shielded by ground where possible
Who is online
Users browsing this forum: No registered users and 5 guests
