ELM406
Output Waveforms
Once the ELM406 has some bounce-free signals
to work with, it can generate outputs based on them.
generated with the U/D output at a high level, while a
counter-clockwise rotation of the shaft results in pulses
generated with the U/D output at a low level. The
direction assumes that the encoder is a standard one,
where the ‘A’ signal leads the ‘B’ for a clockwise
rotation. Note that an Up output is always a result of a
change in A followed by a change in B, while a Down
output results from a change in B followed by a
change in A.
The logic to decode the motion of an encoder
shaft is not as simple as it would first appear. Some
authorities recommend simply monitoring an input and
when it changes, provide an output based on the level
of the other input. This does not always work, as the
encoder can output multiple signals from only the ‘A’ or
or only the ‘B’ contact if the shaft is moved ever so
slightly when at the detent or at the mid-point position
(between detents). Simply seeing one input change is
not sufficient to say that there is any significant shaft
rotation.
Figure 4 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 ELM406 must see a change on one of
the rotary encoder inputs followed by a change on the
other input.
The ELM406 monitors both ‘A’ and ‘B’ transitions,
and determines the outputs based on the sequence in
which the transitions have occurred. This is a better
way to guarantee that the output signals are generated
properly. The internal logic also performs some self-
checking, and monitors for problems such as an output
pulse being initiated before the previous one had
completed, which might occur for some very fast
inputs (the second one will be ignored in this case).
Figure 6 on the next page shows how the output
sequence changes when the Write Enable input (pin 4)
is at a high level. In this case, the Clk output returns
high after only 200 µsec, and the CS output remains
low for an extra 200 µsec. This will result in a write of
the wiper position to non-volatile memory for many ICs
(for example, the ON Semiconductor CAT5112, or the
Intersil X9C102).
The output of the ELM406 is a series of pulses, as
shown in Figure 4 (a representative pulse has been
enlarged and is shown in Figure 5). When the encoder
is moving in a clockwise direction, the pulses will be
Note that the ELM406 uses what is known as 2x
decoding of the signals. This means that for each
A ‘wiggle’ or vibration causes B to change,
but A does not, so the pulse is ignored
A Input
B Input
CS
debounce
delay
Clk
U/D
Figure 4. Output signals (pin 4 = 0V)
ELM406DSA
Elm Electronics – Circuits for the Hobbyist
7 of 9
www.elmelectronics.com