[sdiy] Need goog working rotary encoder in C code..

John Speth johnspeth at yahoo.com
Fri Aug 6 20:15:53 CEST 2021


On 8/6/2021 8:46 AM, Jean-Pierre Desrochers wrote:
>
> I’m doing some tests on a rotary encoder and a PIC16F1783.
>
> A standard Bourns encoder like THIS 
> <https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwjyoqDF3JzyAhUmhOAKHf3lAzoQFnoECAoQAw&url=https%3A%2F%2Fwww.bourns.com%2FPDFs%2Fpec11l.pdf&usg=AOvVaw2RyieyzPnujiOTS7LBcbpw> 
> .
>
> Connected using 2 x 10k pullups with 0.01uf caps to ground
>
> to PORTB of the micro. Interrupt calls (falling edges) used on encoder 
> pins A & B.
>
> I struggled so far to get clean increments/decrements out of it.
>
> Many missing counts occur..
>
> I tried many source codes on the web with no luck..
>
If you're missing counts, it could be due to:

1. Insufficient MCU compute capacity

2. Inefficient or buggy interrupt handler

3. Excessive switch bounce

JJS

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20210806/bc3d2f76/attachment.htm>


More information about the Synth-diy mailing list