I'm working with a K82 MCU and a magnetic encoder attached to a motor. The encoder has 512 counts per rotation; with my targeted motor speed, the encoder output should be around 10KHz. I've configured FTM2 as a quad decoder. The clock is 60MHz and has a prescaler of 16. I am not using semi-hosting for debugging.
The quad decoder is not working properly - it might be losing counts, but that's hard to say because the bigger issue is that the direction is unreliable. When hand turning the motor, if I pause for a moment, then resume turning, there is a high probability that the direction will flip. I've been at this for a while; changing clock frequencies, adding filters, etc. to no avail. Scope captures of the encoder show a very clean signal. What could be causing this?