I'm looking for some code that will perform a correlation on a PIC (or an AVR), and if that fails, some ideas or advice on how to code it. Here's the basic idea of what I'm trying to do: I have a stream of serial data (SD) (252 bits) that I have collected and placed in memory. I want to correlate a portion of this stream with a pseudo noise (PN) sequence (126 bits long), and determine where in the stream the correlation has the best match- this is done by XNORing the two streams and counting up the 1's. I need to do this at every possible delay where I can fit the PN sequence in the serial data (bits 1-126 of SD with bits 1-126 of PN, bits 2-127 of SD with bits 1-126 of PN, ... , bits 127-252 of SD with bits 1-126 of PN) I've been attaching this problem with an AVR (4414), since I have a test board handy, and it has some very convenient features for some other parts of the program, but I also have some brand new 18CXXX's that were just sampled to me., so if you happen to have PIC or AVR code you would be willing to share, I'm willing to trade it for a cool, refreshing beverage the next time you happen to be in Austin. Matt Bennett matt.bennett@andrew.com