Quote Originally Posted by aratti View Post
I have forgotten to say, in my previuos post, that the code snippet is not a quadrature count, and it counts only channel A, while Channel B is used only for direction. So total count per encoder turn will be n/2.

To get a quadrature count you need to detect the rising and falling edges of the square waves, thing that is not possible with the pic you have in use. To obtain the quadrature count you either need additional external logic or you have to choose a pic with the quadrature counter. (Much easier)

Al.
Yes I was buy today 18F4431 for start...
But there is 400 pages of datasheet and I need to be a WIZARD to SETUP that PIC

Regards Robert