OK, looks like I've found the issue, and guess what - nothing to do with the PIC, not surprisingly. Immediately before the call to the EEPROM write routine there is another subroutine that spews out the 8 data bytes to RS232, which along with some spaces and CR/LF ends up taking 44ms, which would of course exceed the 1:1 and 1:2 WDT prescalers. I've also changed the code to ensure that a CLRWDT is performed immediately before the wait for write completion, and it all seems to be working OK. I managed to get some timings today using TMR1, and the times taken was 4.3ms per byte, slight variations between writes, but in the order of uS not mS. I think this backs up some earlier posts which mentioned 4ms writes on other PICs. Many thanks to all those who posted suggestions and useful ideas, hope you don't feel I've wasted your time ! Thanks Andy Jinx wrote: >>OK, I'll put some more debug code in, I can write out to RS232, as long >>as I keep it short, like single characters, it doesn't affect timing too >>much. > > > It's a chore ain't it ? Try to have fun anyway > > >>Maybe I'll try some higher prescalers, I only went up to 1:8 last time i >>tested it. > > > Last night I checked actual EEPROM write times with an F628, F877 > and F452 - all were very close to 4ms. I can't say for certain that the > 12F675 would also take 4ms, but you could easily test that yourself > with the internal timer or a scope. If you can start a write ASAP after > a WDT event it should be safe. A WDT p-s should not be necessary > > -- > 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 -- Andy Pryer Email: andy.pryer@cubecomputing.com Web: http://www.cubecomputing.com Tel/Fax: 01582 703872 ------------------------------------------------------------------ PGP Fingerprint FF1A 67E9 8E52 8689 68DF C86A FCE9 002B 61B8 5C73 -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.