The flash capacity that PIC16LF818 can load is 1K words, and the address range is 0x0000-0x03ff
Device
Programm Flash
PIC16F818
PIC16F819
1K
2K
Challenges and Solutions
Challenge 1
Special programming mode
In-Circuit Serial Programming is short for ICSP, and the controller is programmed via RB6,RB7 pin
Our Solution
Write sequential vectors of RB6,RB7 to programming the controller
Challenge 2
Special address of the controller flash
Our Solution
A device Reset will clear the PC and set the address to‘0’. The ‘Increment Address’ command will increment the PC. The ‘Load Configuration’ command will set the PC to 0x2000
Challenge 3
The data is programmed with 14-bit word forma
Our Solution
This is Intel hex format, take the first data (0x0130)as example. The binary format is 0000 0001 0011 0000,the first 2 bits of high byte should be discarded. So the order into the flash is 1000 0000 0000 11