Thanks for reply. I examined the program for PIC 16f877, part of which I transcribe here: << ifc INTCON,RBIF ;Har porttillst=E5ndet =E4ndrats? goto isrP_NoRBIF ;Om inte: hoppa till n=E4sta= =20 kollrutin ;L=E4s in nya tillst=E5ndet movf PORTB,w ; *** Ingen annanstans f=E5r= =20 PORTB l=E4sas dierkt! *** c INTCON,RBIF ;Kvittera att vi har l=E4st movwf B_PORTBIN ;lagra f=F6r denna samt andra= =20 rutiner p=E5 port B ;Bearbeta tv=E5fassignal genast! ;H=E4mta fasbitarna fr=E5n B_PORTBIN till B_2phState 1:0, de f=F6rra i= 3:2... cc ;Rotate the new bits in... ifs B_PORTBIN,5 sc >>..................... Pleae there is someone that can explain me the meaning of the expressions=20 like:,,,, or the corrisponding instructions in MPLAB=20 assembler? Sincerly Renzo Giurini At 09.49 30/12/01 -0800, you wrote: >Here's some code in the archives: >http://www.piclist.com/techref/microchip/qenc.htm >David > >Renzo Giurini wrote: > > > Hi, > > I would control the rudder of a model boat sensing the direction of a > > compass and/or the direction of wind. > > I think of a simple shaft encoder using i.e. part of mouse. > > > > But how read or detect the direction (clockwise or counter-clockwise)? > > > > Thanks > > Renzo Giurini > > > > -- -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics