Binary Counter Gives Wrong Count Only on Real Hardware

Hello,
I simulated a pulse counting circuit using a binary counter IC and everything matched expected timing. On the real board, the count occasionally skips values when pulses arrive quickly.

Input pulses come from a Hall sensor.

Questions:

  1. Should I suspect slow edges from the sensor rather than the counter IC itself?

  2. Would a comparator or Schmitt trigger cleanup stage solve this?

  3. On the PCB, should sensor inputs be routed away from clock nets and power switching traces?

Hi Eva
Exactly what sensor are you using. Some already have Schmidt triggers built in.
If not it would not do any harm to try this clean up solution.
Cheers Bob

Yes … it’s the most common cause … Hall sensors often have:

Slow rise/fall times (especially with weak pull-ups)
Open-drain/collector outputs
Noise around threshold at higher speeds

At high pulse rates, slow edges can:

Cross the logic threshold multiple times
Violate setup/hold timing of the counter … Result: missed or extra counts

Yeah, it will fix things:

Schmitt trigger buffer: simplest and very effective
Comparator with hysteresis: best if signal is analog/noisy

Read this discussin on comparison b/w the two: https://electronics.stackexchange.com/questions/213461/how-to-explain-the-advantage-of-schmitt-trigger-over-comparator-for-pulse-condit

Yes and its a hetric … Keep sensor lines away from clock traces, switching regulators etc

Route over a solid ground reference … read this guide: Routing Layers and Ground Planes & Power Planes - Engineering Technical - PCBway

Keep traces short and clean
Optional: small series resistor (100 ohm around) for damping

Your issue is almost certainly input signal quality, not the counter IC. Add a Schmitt trigger (or comparator with hysteresis) and improve routing … that normally eliminates skipped counts at higher speeds.

Hi ahsrab

That IS a Schmidt Trigger.
Cheers Bob