PIC16F:
PIC16F family microcontrollers use bits in a special Configuration Word to set protection. These bits are programmed along with the main code and cannot be changed during runtime.
Read protection prevents unauthorized reading of program code and data from the microcontroller's memory via a programmer.
Read Protection Bits:
Bit
Description
State
Write protection prevents software from modifying certain areas of memory. This is useful for protecting a bootloader or calibration data.
Write Protection Bit:
Bit
Description
State
The only way to clear the Code Protection (CP) bit is to perform a Bulk Erase command using a programmer. This operation destroys all content in the program memory and data EEPROM. After this, the microcontroller can be reprogrammed with new configuration bits.
All configuration bits, including protection bits, are stored in one or more 14-bit Configuration Words. These words are located in a special configuration memory area that is not part of the program space.
Configuration Word Location (Example for PIC16F877A):
Address Register
Note: For newer families like the PIC16F1xxx, there may be two configuration words at addresses 0x8007 and 0x8008.
Key Security-Related Bits:
LVP (Low-Voltage Programming Enable): Enables low-voltage programming mode. If this bit is enabled, a high voltage Vpp is not required on the MCLR/VPP pin to enter programming mode. For better security, it is recommended to disable this mode (LVP=0).
MCLRE (Master Clear Enable): Defines the function of the MCLR pin. If the bit is disabled, the MCLR pin becomes a regular digital input, which can make it harder to reset and reprogram the device.
PIC16F microcontrollers have memory locations for storing identifiers.
ID Locations:
Address Description
Microchip Technology
Ask your question: RussianSemiResearch@ya.ru