Hi MInhle,
If you are running with internal oscillator then speed is 4MHz, not 20MHz. Also you should tell that to compiler.
14.2.6 INTERNAL 4 MHZ OSCILLATOR
The internal RC oscillator provides a fixed 4 MHz
(nominal) system clock at VDD = 5V and 25°C, see
“Electrical Specifications” section for information on
variation over voltage and temperature.

Originally Posted by
MINHLE
OSC: INTRO CLOCKOUT
14.2.7 CLKOUT
The PIC16F62X can be configured to provide a clock
out signal by programming the configuration word. The
oscillator frequency, divided by 4 can be used for test
purposes or to synchronize other logic.
CLKOUT is RA6, which is also your I2C data pin. Disable CLKOUT or change I2C data pin to other IO.
If you are not using comparator then disable those.
I hope these modifications will bring up some life to your EEPROM interface.
BR,
-Gusse-
Bookmarks