> -----Original Message----- > From: John Walshe [SMTP:John.Walshe@INPACTMICRO.COM] > Sent: Monday, April 08, 2002 10:33 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: problem writing to '876EEprom > > Hi folks, > I'm writing an array of 20 bytes into EEprom on the F876 starting at > EEprom address 0. I write the 20 bytes and later when I check it I find > that > the byte 20 has overwritten the first six bytes. At the time of writing I > read back what was written and print it out - all is ok. I then > immediately read it back in a second loop and it has been changed. > > I can't see any obvious(to me that is) programming errors. The > eeprom_write() function is supplied as part of the Hitech C and I haven't > had problems with this on the 'F84. I'm using Hitech Picc called from > within > Mplab with full optimisation. > > Any ideas/experiences/comments? > Does your eeprom_write implementation wait for the WR bit to be clear at the start or the end of the function? If it waits for it at the start, you may be corrupting the EEPROM by attempting to read before a write operation has completed. Regards Mike -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics