Firmware · Timers and PWM
A timer can timestamp the edges of an incoming signal to measure its period precisely, even when the counter rolls over.