Since I was concerned about the read doing another SPI cycle, I just went right to the register using code like this: WriteSPI(ToExtSpi2.byte); // Send the next byte while(!DataRdySPI()); // Loop until data ready FromSpi2.byte=SSPBUF; // Read the next byte Seems to work. I've got it talking to a Maxim MAX3100. Thanks for the help! Harold On Fri, 17 May 2002 08:23:52 +0100 "Alan B. Pearce" writes: > >The problem is that it APPEARS (according to the documentation) > >that BOTH WriteSPI and ReadSPI initiate an SPI bus cycle. > > I have not used SPI, but if I remember correctly from my perusal of > the > documentation, to read a character from the SPI, it does a dummy > write. The > SPI hardware then thinks it is writing a byte out to the bus, and so > generates clocks which are actually reading in a byte. The apparent > write is > needed for the clock generation to occur. > > I have done this trick on other hardware I was involved with for > this exact > reason, it was the only way to make the clock generation circuit > work > correctly. > > -- > http://www.piclist.com hint: PICList Posts must start with ONE > topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: > ->Ads > > FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/web/. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body