Quote Originally Posted by champion View Post
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.

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.
Why even bother with the decoder/counter chip. The PIC has plenty of processing power to keep an eye on a few quad-encoders and do serial input/output at practically the same time. If I can do an mp3 player on a PIC16F877, with IR, hard drive, battery monitor, keypad monitor, LCD output, USB connection (thru an FTDI245AM), and a few other things, you can certainly count pulses from a few quad-encoders...

It's kinda like having english as your first language, but also knowing how to speak spanish, and then talking to a spanish-speaking person thru a spanish-english translator. It's like one extra middle-man (or middle chip in this case) that isn't really needed.