Re: [SPAM] RE: [softrock40] Re: Decoding Quadrature Shaft Encoders
- ----- Original Message -----From: Chris StakeSent: Wednesday, April 30, 2008 2:34 PMSubject: [SPAM] RE: [softrock40] Re: Decoding Quadrature Shaft Encoders
I wrote some programs for a pic to decode quadrature signals into a direction and pulses format, theyre here:
Feel free to use any bits that are useful. The main problem I encountered with mechanical encoders was contact bounce.
I've got some PIC code I found somewhere that doesn't have a contact bounce problem, even without any debouncing code.
- There are more than one shaft encoder on the market. I think there
are three or four basic types each using a diferent encoding method
Some are optical some mechanical. The mechanical ones might bounce or
might bounce after the unit ages. I've always wondered if a simple RC
network would de-bounce contacts but because software does not add
parts I've used software. Software debounce is pretty easy - read the
switch multiple times with a slight delay between each until finally
you get 6 or 8 reading that are all the same
This is prety good, explains the different types and is readable too.
Redondo Beach, California