Reading EEPROM

Hi I would like to store a set of numbers on the eeprom and then send them to the PC and view them on the USART terminal. I have this much working. I am storing values from 4 to 23. However i would like to run the code a second time and view the values on the eeprom again (just to see if they are being stored). However when i reprogram the PIC to to read the EEPROM each address of the eeprom just reads 255. Are the values being erased when i reprogram the PIC? Or are they even being stored in the first place? any help would be great. The code is shown below.

Hi thanks for the help however after taking our advice i disabled the 'master clear' function in the settings. this however still hasnt solved the problem. The following have been switched off: watch dog timer, power up timer, master clear, low voltage program, in-circuit debugger. The following have been enabled: brown out detect, data ee protect, int-ext switchover, fail-safe clock monitor.

We are using PIC flash v7.11 with the easypic5 development board along with a 16f887.

If the addresses are coming up 255 each time, then you are either not writing to the EEPROM, or your interface is incorrect. Are you sending the correct signals to read and write to the EEPROM? That information will be in the data sheet for the device.

From our code you can see that we have written to the EEprom. (EEprom_Write(i, j++); command used from example mikroC code). When we run the code it works and the stored values are sent to the PC however when we would like to view it a second time i.e. eliminating lines:

Just to check if i was writing to the EEPROm i ran the simple example eeprom code shown in bold. then i re-ran it excluding the writing commands. And the result was 255 on portb. Therefore it is definetly something to do with the settings. please help