ELM408
Output Waveforms (continued)
decoding (there are two sets of output pulses for each
set of waveforms from the A and B inputs), while the
second (Figure 9) shows 4x decoding. In both cases,
the Write Enable input is high, but this has no bearing
on whether the sets of pulses are generated or not.
vibration (as found in an automobile, or an industrial
setting), and the setting could ‘creep’ with time – even
though the shaft was not actually turned.
Generally, output pulses will occur in groups of
four (between each detent), so resistance values or
settings will repeat consistently as the shaft is rotated
in one direction and then in the other. Depending on
when the shaft changes direction, however, the pulses
may not be generated in groups of four. If your
application demands that the controlled variable must
repeat exactly as the shaft is turned in either direction,
you may prefer to use a 2x decoder setting.
Figure 8 also shows what happens when the
rotary encoder shaft is ‘wiggled’, generating pulses on
only the A or only the B input - the logic detects this
and ignores them. In order for an output to be
generated, the ELM408 must see a change on one of
the rotary encoder inputs followed by a change on the
other input. The 4x decoding is a little different in this
respect. It will generate one pulse in anticipation of a
change of direction when the same input (A or B)
changes two times in a row. Figure 10 on the next
page shows how this typically works. If the logic to
detect and ignore multiple inputs such as this were not
in place, then multiple outputs could occur due to
A ‘wiggle’ or vibration causes B to change,
but A does not, so the pulse is ignored
A Input
B Input
CS
debounce
delay
direction changes
U/D
Figure 8. 2x Output signals (pin 5 = Low)
A Input
B Input
CS
direction changes
U/D
Figure 9. 4x Output signals (pin 5 = High)
ELM408DSA
Elm Electronics – Circuits for the Hobbyist
8 of 10
www.elmelectronics.com