> -----Original Message----- > From: Dan Michaels [mailto:oricom@USWEST.NET] > Sent: Monday, August 06, 2001 9:56 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Need SPI code for 16F877 > > > At 11:24 AM 8/7/01 +1000, you wrote: > >Olin Lathrop wrote: > > > >> Therefore, for most cases, the original code was just fine: > >> > >> bsf portb, clock_bit > >> bcf portb, clock_bit > > > > > >Probably so, but even Microchip suggest something like.... > > > > bsf portb, clock_bit > > nop > > bcf portb, clock_bit > > > > This only adds in another 0.2 usec with a 20 mhz xtal. Isn't > gonna help a great deal if a good-sized cap is hanging on the > pin. Due to instruction pipelining the single noop more that doubles the settling time between the write of the bsf and the read of the bcf. For example a really bad way to do it would be: movlw clock_bit bsf portb, clock_bit xorwf protb The xorwf would invert whatever it read as the result of the bsf and there would be virtually no time for settling. Sherpa Doug -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.