3.1.3.7 Program Access Enable

The Program Access Enable command is used to enable the access to the SAFLOCK and ICSPDIS bits. By default, write access to the SAFLOCK and ICSPDIS bits is blocked for safety to prevent inadvertent and irreversible changes to device configuration. Refer to Enhanced Code Protection for details. Using the Program Data command to write to these CONFIG bits will not work without sending the Program Access Enable command first. Sending the Program Access Enable (0x4C) command with the 22'h27A1A5 payload (the total 32-bit value is 32'h4C4F434B, more easily remembered as LOCK in ASCII) will grant write access to these Configuration bits for a limited-time command window. The write access is terminated once the command window has passed, regardless of the command that is executed during that window. On PIC18 devices, the write-access window is for a duration of one command, so the Program Access Enable command must be issued immediately before every write to the SAFLOCK or ICSPDIS bits.

Figure 3-14. Program Access Enable Timing Diagram