Sean Breheny wrote: > What I said was a bit unclear: > > > On Fri, Mar 28, 2008 at 1:27 PM, Sean Breheny wrote: > >> Hi Bob, >> >> Yes, he is waiting after each byte for the EE write done flag (he is >> actually using the CCS C write_eeprom function, or whatever it is >> called, and he has verified that in the actual generated code it is >> checking for that flag to indicate done). The problem is that if he >> writes the 177th byte this way, it ALWAYS freezes at that point. He >> has to wait an additional 250 milliseconds to continue writing. >> > > If he does not wait this additional time, the PIC hangs there > (presumably because the code which waits for the done flag never sees > it indicate done). If he does wait this additional time before > continuing writing, it works as expected. > > Sean > > This MIGHT be related to what I found, in that the CCS routine does NOT use the Microchip- recommended workaround for the issue. The issue, as explained by MC, was that people were testing a bit in the PIR register to determine when flash writes had ended. The problem was that the EEIF bit in the PIR register could be set early erroneously, causing people to assume that it was done when in fact it was not. The symptoms were that bytes were either not written at all or only partially written (some LOW bits missing). The Microchip workaround is to setup SLEEP such that only an end of flash write would cause the PIC to exit sleep. It seems to be a solid fix. Having said all that, its my opinion that since 7-8 months have expired, that MC has probably corrected it in the PIC12F675 and PIC12F629 as well as the PIC16F648A/-627A/-628A by now. A series of tests could determine if this is the issue. Years ago, I worked for TI who makes millions of chips; I found out that hardware logic is replicated whenever it works, so if one device has a problem with its EEPROM flash write logic, all other devices needing that same function will probably have the same error, whether reported or not. --Bob A -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist