I'm attempting to interface a PIC18F4520 to a 25LC640 via SPI protocol. I'm using the built in MSSP hardware of the PIC. The PIC18F4520 is the only master on the bus. I'm reading 16 bytes of data from the EEPROM 32 times per second. I've double-checked the following items:
- TRIS Registers for SDI, SDO, SCK, and CS
- Baud Rate ~ 1 Mhz
- SPI Mode 0,0
I've checked the signals on an oscilloscope and everything looks fine. I've tried using a BusBee to log the data coming from the EEPROM and 99% of the time it's correct. Every once in a while there are a string of requests where the MOSI (SDO) line does not seem to contain the correct EEPROM read instruction causing the data being clocked into the micro to be invalid. This happens even though I'm writing the same read instruction in the SSPBUF each time. What else can go wrong with a SPI bus?