Hi,

I have an application that writes successfully to EEPROM on the 18F46K22, changing bits at will within its 1k of memory.

I would now like to use the program memory in the same fashion: and know from research that one has to erase a certain number of bytes and write a certain number of bytes across certain boundaries.
I have even hacked a few lines of code that is capable of altering a few bytes in the program space: although it works it is only by empirical experiment.

Indeed I have read the Microchip datasheet but am more confused than enlightened.

Does anyone know how you are supposed to calculate how many bytes you first have to erase and within what boundaries; and how many you have to write to within what boundaries?

Thank you!