> Hi to all, > > I like to use rotary encoder and I have a few questions. > > 1. connecting A channel to INT0 pin setup interrupt on > every falling edge and read B is this valid method ? > 2. Encoder has 4 possible position and each time when > I turn the knob "each small turn" does it go from beginning > thru the end or another word does it go > 00 > 01 > 11 > 01 > > or it does single step of 4? means 00 only? > then next turn is 01? > > any recommendation ? > > thanks > > Andre Because of contact bounce, counting one phase and checking the other for direction results in some pretty wild counts. Attempts at debounce limit your rotation speed. I think the best thing is to use an interrupt driven or polled (often) state machine using the techniques at http://www.piclist.org/techref/microchip/qenc.htm . I've used these both interrupt driven in a large 18F project, and polled in a little 8 pin pic project. They work well! Harold -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist