General Programming Limitations
General Programming Limitations are limitations that apply to devices for the programming function.
- Care should be taken when programming the Phase-Locked Loop (PLL). The PLL only changes when power is first applied to the chip. If you are programming the PLL for the first time, remove power from the PIC18 part after programming and reapply for the PLL to be enabled. If you are reprogramming the device from PLL mode to another mode, first reprogram with PLL off, then remove the power and reapply.
- For all devices with EEPROM memory, erase operations will also erase EEPROM memory.
- If your code makes use of port pins that correspond to clock and data pins* in Programming mode, you may not be able to reprogram your device.
When Internal Master Clear (MCLR) is used with the debugger or emulator for programming, both Vpp and Vdd are powered together. Then, Vpp is pulled high to Vihh to enter Programming mode. This means that your code will be running before Vpp goes to Vihh. If that code makes use of port pins that correspond to clock and data pins in Programming mode, there is a chance their values may not be 0, as necessary to enter Programming mode. Therefore, the device could not be reprogrammed.
Workaround
When External MCLR is used, this is not a problem, as Vpp can go directly to Vihh. Also, if the external oscillator is used, it can be kept from running, thus, keeping the code from running, until Vpp is at Vihh.
*Clock and Data Pins: Please refer to the Programming Specification for your device to determine which port pins correspond to the clock and data pins used in device programming. E.g., for many Microchip devices, those pins are RB6 and RB7 respectively.