You don't say what kind of EEPROM you are trying to write, but I'm presuming it's an I2C one?. A 20MHz PIC can certainly write out faster than an I2C EEPROM can receive it, your code should be written accordingly, bearing in mind the speed limitations of the EEPROM - you can get those details from the datasheet.
You could also have a problem with your I2C routines, have a look at my I2C tutorial for software I2C code which I know works. If you're trying to use the I2C hardware in the 16F877, I have heard it's very difficult to get working, and that the application notes from MicroChip don't work.