At 07:05 PM 5/17/03 +0100, Andy Pryer wrote: >Yes, first I tried immediately before the call to the write subroutine, >and when this failed to work I switched to clearing the WDT before the >write of each byte. The routine writes a total of 8 bytes. Do you service the watchdog while you are waiting for the write to finish? In other words, are you hanging around in a loop waiting for the current write to finish so that you can do the next write? If so, you need to wait a bit (4 or 5 ms), tickle the dog, then wait for the write to finish. The first part of the problem is that although the watchdog has a nominal 18 ms timeout period, the actual timeout period is -50% .. +100%. It *could* timeout in as short a period as 9 ms. The second part of the problem is that although the eeprom write is supposed to be about 8 ms, it could be longer. I usually deal with this type of problem by having the watchdog serviced in my background routine. The background routine takes care of time-keeping, serial stuff, etc - whatever I can throw in there and (usually) operates at 1.024 ms intervals. Anytime I am waiting for something to finish, I call the background routine. So my way of dealing with your problem would be to load a counter with a value that is somewhat longer than the worst case eeprom write time and then repeatedly call the background routine and decrement the counter. Its a tiny 3 line loop. If the counter times out, that is a failure and I deal with it appropriately. I know for a fact that it is possible to write the eeprom in a 12f675 - I do it in several different products. dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 19 years of Engineering Innovation (1984 - 2003) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads