PIC18F:

 

1. Protections:

PIC18Fxxxx family microcontrollers have several code and data protection mechanisms, which are implemented using configuration bits set during device programming.

 

1.1 Code Read Protection:

The primary protection mechanism in PIC18Fxxxx is read protection of the program memory. This prevents the firmware from being read from the device via a programmer. Protection is enabled for different memory blocks separately. If a protection bit is set (programmed to '0'), the corresponding memory block cannot be read externally.

Code Protection Bits:

Bit Description CP0...CPn Read protection bits for Flash program memory blocks. CPB Read protection bit for the Boot Block. CPD Read protection bit for the Data EEPROM memory.

 

Unprotection:

To disable read protection, a full Chip Erase must be performed using a programmer. This operation irreversibly erases all program memory and EEPROM data. After erasing, new configuration bit values can be programmed to disable the protection.

 

1.2 Write Protection:

Write protection prevents the modification of memory contents during application execution. Like read protection, it is configured for different memory areas. If a write protection bit is set, any attempt to write to the corresponding block will be ignored.

Write Protection Bits:

Bit Description WRT0...WRTn Write protection bits for Flash program memory blocks. WRTB Write protection bit for the Boot Block. WRTC Write protection bit for the configuration registers. WRTD Write protection bit for the Data EEPROM memory.

 

2. Configuration Bits:

Configuration bits are special memory locations that define the key operating parameters of the microcontroller. They are read on reset and cannot be modified by software during operation (unless the WRTC bit is cleared).

Configuration Registers Location:

Address Register 0x300000CONFIG1L 0x300001CONFIG1H 0x300002CONFIG2L 0x300003CONFIG2H 0x300004CONFIG3L 0x300005CONFIG3H 0x300006CONFIG4L 0x300008CONFIG5L 0x300009CONFIG5H 0x30000ACONFIG6L 0x30000BCONFIG6H 0x30000CCONFIG7L 0x30000DCONFIG7H

Key Security-Related Configuration Bits:

LVP (Low-Voltage ICSP Enable bit): Enables Low-Voltage In-Circuit Serial Programming mode. When this mode is enabled, the PGM pin becomes active, and a high voltage on the MCLR pin is not required to enter programming mode. For enhanced security, it is recommended to disable this mode (LVP=0).

MCLRE (MCLR Pin Enable bit): Determines whether the MCLR pin will be used as an external reset line or as a regular digital input. Configuring this pin as an input can make it more difficult to control the device with a programmer.

 

3. Unique Device ID:

PIC18Fxxxx microcontrollers have unique identifiers that can be used for serial numbers, tying firmware to a specific device, or for cryptographic purposes.

ID Locations:

Address Description 0x200000 - 0x200007 User ID (8 bytes, user-programmable) 0x3FFFFE - 0x3FFFFF Device ID (Device and Revision ID, read-only)

The Device IDs are unique to each PIC model and also contain information about the silicon revision. The User IDs can be programmed once to store any information, such as a serial number.

 

Microchip Technology

 

Ask your question: RussianSemiResearch@ya.ru

 

 
RussianSemiResearch. © 2008-2025.E-mail: RussianSemiResearch@ya.ru