This may help you. If you have a look at the Connecting a TI calc to a PIC thread you`ll see the details of a good protocol for inter device communictions. Very simple and could be clocked up to a high rate. I used a similar one to get up to comms of 30mhz+. >I am using 2 PICs (16f874) on 2 boards to control a system. The board >communicate via SPI with Fosc/4. The one board switches relays to power >some 220v solenoid valves. Switching the relays on presents no problems but >I can't get them switched off. Removing power obviously does, but I >suspect >the SPI flakes out due to interference from the relays switching on. The >SPI >run is about 30cm. My questions are: > >1) Should I use a protocol for the SPI and if so, where can I find one that >is reliable and simple? > >2) Shielding of the SPI is not an option, how to I eliminate the RFI from >the relays? I have RFI elimination on the DC side, I'm talking about the AC >side > >3) Should the SPI lines have termination of some sort? > >4) If I halt the SPI on the salve and restart, does it throw away the last >incomplete byte received? > >Thanks >Stephan ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com