AN #115 - Quadrature Decoder/Counter and Display


For the encoder was used the one from an old "mouse". There are two of them in each mouse.
The resolution of both axes is 0.05 mm and the display lloks like this: [ X -106.45 mm ] for example

For each ax I used an AT90S2313-10 with display(16 x 1).
The problem of the "missing pulse" during a change of the direction within a pulsewidth, was solved with software. Encoder phase-A generates an interrupt for both edges.
INT0 and INT1 are connected because the 2313 does not have a toggle interrupt like the 4433.
In the ISR only the phase-B and phase-A need to be compared with each other.
If A = B then increment counter otherwise decrement counter.
The counter value converting to a value in mm is dependend of the used encode and mechanical construction.

For the signal conditioning between the encoder and AVR was used a 74HC14.

Download source code in an115.zip