Can I catch a 500ns low pulse while monitoring in a tight loop that does nothing else. No code at this time.
This would be the simplest vs. pin change.
Feel free to move if not in the right area,
Can I catch a 500ns low pulse while monitoring in a tight loop that does nothing else. No code at this time.
This would be the simplest vs. pin change.
Feel free to move if not in the right area,
500 / 62.5 = 8 clock cycles.
Barely if you disable interrupts. In which case millis / micros may no longer be accurate. And, you will very likely not be able to do anything inside the loop. And, you will have to use direct port I/O.
It is very easy to lengthen that pulse. A transistor, two resistors and a capacitor.
I don't want to modify the hardware a PCB. what is the right way to do this in software>
See reply #1.
Why not use a pin change interrupt?
That is the s/w only solution to this.
That way you don't have to poll for it, don't have to mask interrupts, and it won't be missed as the AVR pin change circuitry will detect it and create the interrupt.
Anytime you have realtime needs like this, interrupts are solution.
--- bill