<div dir="ltr"><div><div><div><div>Yup<br><br></div>I almost always debounce switches by polling in a timer interrupt. For push switches (eg. keyboards) a slow polling interrupt is sufficient. For an encoder knob a 1kHz interrupt is generally way fast enough.<br><br></div>Generally, the worst is to use an edge detect interrupt to do switch detection. A noisy (glitchy) transition can end up causing multiple interrupts. Worst I've seen was when a switch failed mechanically and ended up causing a few thousand interrupts a second. That extra interrupt load caused the CPU to overload and they system failed.<br><br></div>Volker: One neat trick might be to disconnect the encoder then use some circuit to recondition the signal to pass through to the rest of the system. eg. run it through a micro or a 555 or a filter + hysteresis (74xx or op amp) to deglitch it.<br><br></div>encoder->magic->rest_of_circuit.<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 6, 2016 at 7:51 PM, Mark Atherton <span dir="ltr"><<a href="mailto:markaren1@xtra.co.nz" target="_blank">markaren1@xtra.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div class="m_1227323116405734306moz-cite-prefix">See if you can take the encoder out and
inspect it.<br>
<br>
If it's optical, it may be a fluff-problem, or dirty pickup
optics; a good clean may help, <br>
<br>
If its a mechanical encoder, again, disassemble and clean it, it
could still be a fluff-problem. A squirt of contact cleaner may
also be beneficial<span class="HOEnZb"><font color="#888888"><br>
<br>
-mark</font></span><span class=""><br>
<br>
<br>
On 6/11/2016 5:57 PM, Charles Manning wrote:<br>
</span></div><span class="">
<blockquote type="cite">
<div dir="ltr">
<div>A capacitor across the contacts might help.<br>
<br>
</div>
<div>What is the value of the pull up resistor? How often do you
expect to see pulses (if it was clean)?<br>
<br>
</div>
<div>Set the capacitor so that the RxC = about 1/10 of the
period of the nominal "clean" frequency you want.<br>
<br>
</div>
<div>Alternatively, if you have a scope handy and can see the
glitches, set the value to about 5 x the period of the
glitches.<br>
<br>
</div>
<div>That should give you a reasonable starting point.<br>
<br>
</div>
<div><br>
</div>
Rotary encoders should be doing quadrature encoding. I've seen
that messed up in firmware at least 50% of the time.<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Nov 6, 2016 at 5:44 PM, Volker
Kuhlmann <span dir="ltr"><<a href="mailto:list0570@paradise.net.nz" target="_blank">list0570@paradise.net.nz</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a
digital power supply that has developed a bounce problem
with<br>
its twiddle knob, making it pretty much unusable. Someone at
the last<br>
meeting mentioned the quick fix is to put in a capacitor,
but I don't<br>
remember the details. Is the capacitor across the contacts?
And what<br>
value? 100pF? 100nF? Wouldn't burn 100nF the contacts out?<br>
<br>
Obviously this tool has s... firmware, but I can't fix that.
Plan B is<br>
to try and replace the encoder, but if a quick fix works
that'll save<br>
some headaches with models, sizes, etc.<br>
<br>
Thanks muchly,<br>
<br>
Volker<br>
<span class="m_1227323116405734306HOEnZb"></span></blockquote>
</div>
</div>
</blockquote>
<br>
</span></div>
<br>______________________________<wbr>_________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.<wbr>co.nz</a><br>
<a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">http://lists.ourshack.com/<wbr>mailman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/<wbr>pipermail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.<br></blockquote></div><br></div>