WRITE PROTECT

Some PICs have the ability to write to their own program memory (the executing program is able to do this itself).

The write protect attribute enables or disables this ability.

Normally an executing program will not need to write to itself, sometimes however the software programmer will want to create a program that can store information in the memory of the program (perhaps a lookup table or some execution parameters). Sometimes the program may even contain a bootloader that allows a new program to be downloaded to the chip and replace the existing program.

Allowing a program to modify its own program memory can be a bad thing since this allows a program to corrupt itself. It also allows code protection to be circumvented since it may be possible to download a section of code that reads the rest of the program and outputs it via a general purpose I/O pin.

In general it is a good idea to allow programs to write to their own program memory during development.