>-----Original Message----- >From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] >On Behalf Of Ariel Rocholl >Sent: 20 August 2007 11:28 >To: Microcontroller discussion list - Public. >Subject: [PIC] I2C and DS32C35, problems > >5) Diagnose with logic analyzer. I can find it working >perfectly for as many START-WRITE-STOP operations I can do. >When I try to START-READ-STOP, I can see the RTC sending READ >data back with expected values, but the STOP never happens. > > //Read RTC > i2c_start(); > i2c_write(0xD0); //WRITE > i2c_write(0x00); //address 00h > i2c_start(); > i2c_write(0xD1); //READ > nTest=i2c_read(); > nTest=i2c_read(); > nTest=i2c_read(); > nTest=i2c_read(); > i2c_stop(); //end RTC read Does the i2c_read() function automaticaly ACK the slave? Remember that the master must send a NACK (not acknowledge) to the slave on the final read. Some slaves work ok if you don't do this, many don't. 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