> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of solarwind > Sent: 05 March 2009 06:42 > To: Microcontroller discussion list - Public. > Subject: Re: [EE] AS1107 Driver - Did I do it right? > > > > Thanks for posting. My code is pretty much the same as yours. However, > it seems that your chip does things a bit differently. According to > the data sheet of my chip (I may be interpreting it wrong, however), > the chip select line acts like a latch and should be strobed after 16 > bits have been clocked in According to the datasheet you posted a link to you have interpreted this incorrectly. Check out the timing diagram on page 8, this is a typical SPI peripheral that requires a chip select to be pulled low before clocking data in, and the entire data word is internally latched on the rising edge of the chip select. Also why the 100us delays? The device can accept a minimum clock period of 100ns, you are massively slowing down the bus speed here. Also why are you bit-bashing the SPI? Does the 18F part you are using not have an MSSP unit? Regards Mike. ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist