> I am stuck and I need your help! I have 2 PIC16F877 Micros. They are > communicating with each other through SPI (One master and one slave). > The Master sends 2 bytes of data to the Slave - one is the "command" > byte and one is the "data" byte. The Master IC always sends out the > "command" byte first follows by a "data" byte. The Slave IC gets > interrupted every time the SPI reception is completed. > > Here is my question: How do I write the code so that the Slave knows > which byte is the "command" byte and which byte is a "data" byte? You deselect the slave after the data byte, and the slave always interprets the first byte after select as a command byte. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu