On Tuesday 24 February 2004 05:57 am, David Duffy scribbled: > Here's some working EE code on a '628. > > ... > > > I do the first write, then exit back to the main loop right away > to deal with other tasks. Checking the eeprom busy state at > the start of the eeprom write is a more efficient way to do it. > Clearing the write enable during writing *may* be causing > your problem. I wait until the write is finished and that works. > David... Interesting way to do it. In my case, I would just wait in a busy-loop u= ntil=20 that flag is set, and then continue with the rest of the code. This is c= ause=20 the main routine really does not *need* to do anything else during this t= ime. I can see an easy way to set a timeout with this ... ie: while waiting un= til=20 the flag is set, I could/should add a "timeout" counter which would assum= e=20 that something went wrong if the flag was not set in a certain amount of=20 time. What's a reasonable amount of time for this? Hopefully it's less = than=20 the time between EEPROM writes in my app. I've calculated that my app ca= n=20 write a new value to EEPROM as fast as every 0.29 secs. [ Hmmm ... that=20 seems pretty short now that I think about it, but it's the very *worst* c= ase.=20 ] Cheers, -Neil. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads