This investigation was started after I ordered the free sample kit for the Circuit Cellar contest, called Mad Dash for Flash Cash. There seems to be many ways to program the device. Here I have investigated two ways of programming the PIC18F252.
The Microchip document Programming the PIC18FXX2/FXX8, describes programming either the high or the low voltage In-Circuit Serial Programming™ (ICSP™). This document, 39576a.pdf, is available from the Microchip web site.
Data is clocked with a 10MHz clock maximum, into the PIC, in multiple 20 bit instructions, made up of 4 bits of command, and 16 bits of operand. Between each command and operand is a gap of 20ns and between each block of 20 bits is a gap of 20ns. The operand can contain the word of data payload to be programmed. This might mean the PIC18F252 could be programmed in about 33ms, but it is doubtful that a parallel port on a PC could support that throughput.
Further investigation into the contents of a “blank”, as shipped, PIC18F252 revealed a program residing from 0000 – 01BF. This code is a serial port bootloader and if allowance for this code is made, then the device can be programmed via a COM port on a PC. The listing for the code is here. I disassembled the object code after reading the PIC18F252 with my PICstart®Plus development system, and comparing the code with that shown in AN851, A FLASH Bootloader for the PIC16 & PIC18. To handle the PIC18F252, the PICstart®Plus needed to be upgraded from 1v5 to 3v0 firmware after obtaining a PIC17C44 from the local supplier.
For more detail: PIC18F252 Programming
Current Project / Post can also be found using: