John: I'm glad I was able to help by providing my SPI code which has worked for me consistently in spite of all the warnings being posted. It directly drives a DS1305 RTC. When I provide code on this list, it is meant to help others by showing them what worked for me. It isn't meant to be a gold standard. Many times PICers just need to see how someone got something working. They can then modify it to their hearts content. While I appreciate those who try to help me avoid potential problems, the old adage is still true: It's not necessarily what you say, it's how you say it. Sam.... "May the roof over your head never leak until it rains gold." ("`-''-/").___..--''"`-._ `6_ 6 ) `-. ( ).`-.__.`) (_Y_.)' ._ ) `._ `. ``-..-' _..`--'_..-_/ /--'_.' ,' (il),-'' (li),' ((!.-' -----Original Message----- From: John [mailto:jsand@PIXIE.CO.ZA] Sent: Tuesday, August 07, 2001 2:18 AM To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: Need SPI code for 16F877 Hello Sam, Scott & PIC.ers, mmmm... I've been well helped by your SPI code, Sam. Thanks for that, & I've now got `up-and-running' bit-bashed asm code for driving an AD7715 16bit bridge transducer front end for my instruments. It works really well, and I don't mind sharing it with anyone else who wants to do this kind of thing. Why didn't I use the MSSP in the 16f877? Let's not go there... it's a long story. I'm sure what Scott was getting at was your code's non-use of read-modify-write instructions. This was one of the mods. I made for the 7715 routines & learnt long ago < ie the hard way :( > that any bit-twiddling instructions otta be wrapped in mirror registers. best regards, John >Date: Mon, 6 Aug 2001 11:22:47 -0700 >From: Sam Linder >Subject: Re: [PIC]: Need SPI code for 16F877 > >Instead of just criticiz...... .. .. > >> bsf SCLK // set SCLK high >> bcf SCLK // set SCLK low > > > >Are you sure that's the way you want to toggle an I/O? It probably >works fine, most of the time.... butt... > > >Scott e-mail from the desk of John Sanderson, JS Controls. Snailmail: PO Box 1887, Boksburg 1460, Rep. of South Africa. Tel/fax: Johannesburg 893 4154 Cellphone no: 082 741 6275 email: jsand@pixie.co.za Manufacturer & purveyor of laboratory force testing apparatus, and related products and services. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.