Arduino Interrupts Suck, FPGA to the Rescue

It should be easy enough to read PWM signals using Arduino, right? At least that's what I thought, but I found that there's all sorts of gotchas and maybe even bugs in the Arduino libraries. I eventually gave up and built a custom FPGA to do the job. Overview of PWM PWM, or pulse width modulation, is just a single wire that alternates (pulses) between high and low voltage. It's up to the attached devices to decide how those highs and lows are interpreted. Variables include the pulse frequency and how long the signal is held high or low. Some devices care about the duty cycle, which is just the percent of time that the signal is high. Others, like an RPM sensor reader, only care about the frequency of pulses. Hobby servos care about the pulse width, or the time duration that the signal is high. For hobby servos, the pulse width varies between 1 and 2 milliseconds +/- a few hundred microseconds depending on the servo. The servo translates the pulse width to rotational angles...