Here I am, programming a microcontroller to read an incremental encoder for a circuit that I'm working on and wondering, why the state machine, that I coded for the encoder, isn't working as it should.
I coded the state machine to follow along as the signals A and B go high or low and added in a safety that throws an error if the state machine tries to skip a step in the quadrature. I flashed the code into the chip, expecting it to work as planned, but to my demise, it seemed to throw an error every time I turned the knob.
So I went ahead and looked at A and B signals on the encoder. Here's the interesting part:
As I ever so slowly turned the axle clockwise, both A and B were pulled to ground in the exact same moment and only jumped up one after the other.
So instead of this (taken from the datasheet),

what I really have is this.

Now I know that it still outputs a signal which can be used for detecting rotation and direction, but this isn't the point. The
datasheet says the signal is quadrature, but there are only three different states which can be found on the output.
Just to make sure that I'm not crazy (and because I happened to have a spare), I decided to check the other one as well. Same story.
Does anyone have an idea what might be going on? I bought these encoders directly from Mouser, so I don't think they are counterfeits (they look and feel pretty solid).
The exact part number is PEC16-4120F-N0012.