This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

P89LPC932 E2 Write Eratta

I have encountered an error on the Philips LPC932 Rev C chip. The error has been verified at 9.216 MHz (well below max rated speed) and occurs when multiple consecutive bytes are written to the E2 memory.

Sometimes, not always, one or more of the bytes are erased and not reprogrammed. This looks like an error common to early versions of the Quick Pulse algorithm.

The work around is: (using Keil example as a base)

void EEPROMwrite(unsigned int adr, unsigned char dat)
{
    unsigned char Retrys = 10;

    do {
	EA=0;
	DEECON=(unsigned char)((adr>>8)&0x01);
	DEEDAT=dat;
	DEEADR=(unsigned char) adr;
	EA=1;
	while((DEECON&0x80)==0);  // If WatchDog enabled ... pat it
    } while ((EEPROMread(adr) ^ dat) && --Retrys);
}

I have found that a Retry count of two seems to handle the problem ... but "If at first you don't succeed ... "

0