Hi all!
I'm having some trouble/fun trying to communicate serially with a PIC16F627. I am using an optical (quadrature) encoder, with a quadrature decoder w/ a built in counter. The counter will count the up/down pulses, and hold them in a shift register where they can be read serially (in 22 bits). I want to be able to have the PIC read the serial data (as many bits as possible {8?}) and display it on an LCD. Should I be using the SERIN function? If so, how do I make sure that the bits that are read into the PIC start with the LSB of what the counter has in it's shift register? Also, I need a little help with selecting the baud rate. I have included a snippit of the code I am using as well as a brief explanation of how the counter's shift register works.

Code:

loop:

high plsr
low Plsr
low Cs
serin cntdata,4,total
pause 22
high cs
LCDout $FE, 1, "position", $FE, $C0, BIN total
Pause 1000

goto loop

Counter Shift Register Link:

http://www.genapta.com/WORD%20DOCS/A...nterfacing.pdf

Thanks a lot for all of your help, and any input would also be appreciated. As soon as this all works I have been working on a writeup that I will post on the forumn for all of those first time encoder users like me.