Hi everyone, I have some nice code that has been using the internal EEPROM of the 16F877. The code is stable and does what it's supposed to do. I now have an external 24LC64 EEPROM connected to the chip and using the master-mode hardware i2c functions, have successfully read and written to it with separate code. It seems to work fine. Unfortunately when I put them together, it all falls apart. After much mucking around, I discovered that the GIE bit is cleared by something whenever a read or write to the i2c device occurs. I am sure it is not part of my code and so am starting to think that it is in the hardware of the 'F877. Has anyone seen this before?. Does anyone know of some hardware event (specifically relating to i2c stuff) that can clear the GIE? What my test code does is to write the numbers 00 to ff at addresses 0x00 to 0xff in the first page of the 24LC64, and then read them back and display them on LEDs. The interrupt service routine has a "heartbeat" LED that normally flashes continually at 5Hz. While the code begins to initialise, the heartbeat LED flashes merrily away, but as soon as the EEPROM is written to and read from, it stops dead. the code however, has not crashed, it pauses while the EEPROM is being written to, then dutifully starts to display the contents on the LEDs. Via the ICD I can see that the GIE has been cleared by someone, hence stopping the heartbeat LED. There are no "BCF INTCON,GIE" lines in my code. I suppose there is a chance that some crap code is trashing INTCON, but I have yet to find it. Any ideas? Dave. (Desperate) -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.