Does anyone know of some example code implementing an interrupt driven hardware serial port read/write routine for any of the PIC16Xxxx devices with hardware serial ports? Let me give a little background. I am working on an application with a PIC16F876. The PIC is decoding the quadrature signals from three optical encoders. It communicates with a single board PC through a MAX232 chip at 9600 baud. The quadrature signals will be coming at less than 1kHz. The PIC simply runs in a state machine, comparing the current channel states with a list of valid states and increments/decrements a counter accordingly. It will loop at about 30kHz. I chose not to use standard encoder chips because of cost. HP quadrature decoders are nearly $20 each in small quantities! I am cleaning up the signals a little with a schmitt trigger inveter on each channel. I realize I may loose a count or two every now and then due to noise, but this won't matter much. If it becomes a problem, I may add a requirement of 5 or so identical consecutive readings before a change in position is registered. The communication protocol is pretty simple--read a two byte command and output 10 bytes of data with header, checksum, etc. There are several ways to implement the serial routine. It seems to me that this would be a good situation to use an interrupt. The PIC could continue looping between bytes as the data is sent and received. However, this is my first program using interrupts in a PIC. Can anyone point me to a similar example? I looked through the application notes but only found something for a PIC17Xxxx device. Am I on the right track, or is there something I am missing? Thanks, Paul Brown ___________________________________________________________________ Get the Internet just the way you want it. Free software, free e-mail, and free Internet access for a month! Try Juno Web: http://dl.www.juno.com/dynoget/tagj.