Picdude wrote: >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 until >that flag is set, and then continue with the rest of the code. This is cause >the main routine really does not *need* to do anything else during this time. > >I can see an easy way to set a timeout with this ... ie: while waiting until >the flag is set, I could/should add a "timeout" counter which would assume >that something went wrong if the flag was not set in a certain amount of >time. What's a reasonable amount of time for this? Hopefully it's less than >the time between EEPROM writes in my app. I've calculated that my app can >write a new value to EEPROM as fast as every 0.29 secs. [ Hmmm ... that >seems pretty short now that I think about it, but it's the very *worst* case. > My application has to monitor a RF remote receiver, a push button, flash an led and do serial comms in between the eeprom writing and reading so the wait-while-previous-byte-writing was the best way to go for me. I think the eeprom byte write time on a 'F628 is in the order of 8-10ms. David... -- ___________________________________________ David Duffy Audio Visual Devices P/L U8, 9-11 Trade St, Cleveland 4163 Australia Ph: +61 7 38210362 Fax: +61 7 38210281 New Web: www.audiovisualdevices.com.au ___________________________________________ -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads