Thanks Dave. My "issue" is that I have a 10-mS interrupt running to keep track of elapsed time. I have several EEPROM writes and since EEPROM writes take a while I don't want to lose time by stopping the interrupt for every write.
I did a test program where I repeatedly wrote to EEPROM with a 'random' WORD. For each write I then read back the value that got stored in EEPROM. It turns out that the error rate due to interference from the interrupt was quite low, about 0.04% (~400 errors in a million writes). So what I ended up doing was to do each write with a call to a subroutine:
EEwriteWord:
WRITE addr,xW.byte0:WRITE addr+1,xW.byte1
READ addr,xR.byte0: READ addr+1,xR.byte1
IF xR != xW then
INTCON.7=0
WRITE addr,xW.byte0:WRITE addr+1,xW.byte1
INTCON.7=1
ENDIF
RETURN
This seems to be working well. While the EEPROM write takes several mS the READ is pretty fast, so this doesn't add too much overhead.





Bookmarks