I am trying to connect a PIC16F877 to an Atmel AT45D041A 4 mega-bit DataFlash chip. However I am having some difficulty with the build in SPI port on the PIC. I am able to get it sending data, however it appears to be sending bits out SO on both the rising AND falling edges of the SCK output. Also, I only get a total of 4 SCK clock cycles for each byte sent. I can see nothing wrong with my configuration of the SPI registers (they match examples from the Microchip application notes and other sources), I have the TRIS port configured correctly (I am getting output), and I have all unused pins grounded via resisters. No other code or peripherals are in use at the time other than the UART. I have tried this with the Atmel chip in and out of circut. I have also tried running the SPI clock at Fosc/4, Fosc/64 and TIMER2/2. I have exhausted all avenues I can think of tracking this down, and I may resort to bit-banging it if I can not get the built in peripheral to work. However that is far less desirable. Thanks for any help. Linus Dillon. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body