David Bender

Interface push button rotary encoder on 1 analog input

6 posts in this topic

  It works pretty well except for an occasional reverse tick but that's probably a flaw in my code.


The reverse ticks might be due to a "blocking" part of your code when it calls "begin_lcd_write". (Blocking probably isn't the right word.)

But while your main loop is inside this function it could miss an update from the ISR. I'm probably wrong. Just a thought.


I've found whenever I used rotary encoders I had to proccess the transitions quickly because there was a fair amount of phantom transitions, I was probably using very cheap rotary encoders too.

Share this post

Link to post
Share on other sites

begin_lcd_write() just buffers data and initializes the TA0.1 IE.

The LCD data are clocked in the timer interrupt handler so there really isn't any blocking.


I think an improvement would be to supersample 8 times, average and then use the change in value as a determination of how far the encoder turned, rather than only comparing discrete levels.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now