by Martin Clausen (mc AT rotgradpsi DOT de)

Flash-PIC-Programmer for connection via parallel port

Table of contents:


System Requirements

8086, some RAM, about 50kb harddiskspace, parallel port DOS or Windows (see this note)


picprog [/h] [/log] [/info] [/list] [/init2] [/standby] [/read] [/continue] [/compare] [/noF84] [lpt1|lpt2] [/w:FILENAME]

Parameter definition:

/logwrite output to picprog.log, forces /info
/infoshow full programming information
/listlist of supported PIC
/init2use /MCLR before Vpp power-up mode
/standbyloop program
/continuecontinue programming also while errors occur
/noF84blocks PIC16F84 mode
/lptXdefinition of parallel port
/readdata transfer from pic to file, reverses /w: command
/comparedata comparison of pic and file, overrides /w: command
/w:erase and write PIC, uses hex-file, extension will be ignored and set to .hex

If you use WinXX, you might create a link to PICProg on your desktop. Then you can insert there the command line. So you need only one click to program your PIC and one to close the window.

Otherwise you could also use the /standby option. Then you activate the window where PICProg is running and press simply a key. This especially useful during the development of a new program or if many equally programmed chips are needed.

PICProg does not cache the hex-file. It is read during the programming process, therefor you can be sure that the latest version of the file is programmed.

For the readout of a chip all data from the chip is requested twice to ensure correct data. A file created through the readout of a chip will differ from the file that was used to program the chip, because for the readout the hole memory must be read, while the original does not define every memory cell.

To support the batch mode, feedback can be received via error levels:

0operation successful
1operation failed
2error in hex-file
3no programming to do, no file selected or no LPT selected
4fatal error

ID, configuration word and EEPROM data should be included in the hex-file at:

AddressMemory Type
00000H - 01FFFHprogram memory
02000H - 020FFHID, configuration word
02100H -EEPROM

Here an example by Thorsten Klose to make this clearer:

Supported PICs

This program recognises the following PICs:

12F629; 12F675
16F72; 16F73; 16F74; 16F76; 16F77
16F84A; 16F84A REV2; 16LF84A; 16F87; 16F88
16F627; 16F627 REV2; 16F627A; 16F628; 16F628 REV2; 16F628A; 16F628A REV2; 16LF627; 16LF628
16F629; 16F630; 16F648A; 16F675; 16F676; 16F818; 16F819
16F870; 16F871; 16F872; 16F873; 16F873A; 16F874; 16F874A; 16F876; 16F876A; 16F877; 16F877A

The following chips can still be programmed, but they are not recognized:

16C84; 16CL84; 16F83; 16F84

Other PICs may be supported. Please contact me for details. Before the programming the ID of the PIC will be searched in picdata.dat. If no data for this chip is found the program tries to use the PIC16F84 mode. This program does not check if PIC and hex-file match.

Principle of Operation

Power Supply

Diode D3 protects the circuit against reversed input voltages. C14 and C7 stabilises and decouple the operating voltage. A standard voltage regulator (type 78L05) generates a 5 volts voltage to supply all chips.
The TL317 forms with the transistor a between 13 and 0.8 volts switchable voltage source. The higher voltage is set by the ratio of the resistors R5 and R11 according to the following formula: Uout = (1 + R5/R11) * Uref . Uref is the reference voltage of the TL317, which is 1.25 volts. If the lower voltage is required, the transistor will conduct and the formula Uout = Uref + Vce is valid. Vce is the collector- emitter-voltage of the transistor. This voltage is with 1.55 volts still to high to be regarded from the PIC as low. Therefore the diode D5 reduces Uout by 0.7 volts. R10 makes sure that a minimum current is always flowing through the diode, because otherwise the leak current may build up a to high voltage.
Three CMOS switches of the 74HC4066 are used to switch the power supply of the PIC on and off. The minimum supply voltage of the PIC can only guarantied because all three switches are used. A CMOS switch of the 4000 series would have had a to high on resistance.

PC Connection

The pull-up resistors at the inputs of the 74LS14 define the input level, if no PC is connected. Important is the choice of the bipolar LS chip. With a CMOS chip at latch up can occur, if the circuit is connected to the PC but not to a power supply. Beside this the LS series have the appropriate switching levels for the parallel port.
The data pin of the PIC is used bidirectional during programming, but the parallel port has only unidirectional inputs and outputs. Therefore a CMOS switch is employed to switch the signal according to its direction.


Assembling Instructions

Remove from the tree 40 pin sockets the bridge in the middle. Insert them and also the 18 pin sockets into each other. Now plug both socket packets in the pcb, the 18 pin sockets in the space inbetween the 40 pin sockets. Then solder both and complete circuit. Mount pcb into case via screws direct at the sockets. Mount sub-d connector into the case and connect it to the pcb via wires. Parts should not be higher then 8 mm, because otherwise the sockets would not be high enough to reach through the case surface.

Possible Causes of Errors

Download of Program and Circuit

The part description in schematics is read as follows:
part type + value in exponential form + package description + subpart number in package
for example: C1040805,1 means Capacitor, 100nF, package SMD 0805, first subpart in package

If you have any problems, please do not forget to mail me:

Similar Projects

IC-Prog Universal-Serial-Programmer with Windows softwareBonny Gijzen
PonyProg Universal-Serial-Programmer with Windows software

Disclaimer: No warranty at all!
Copyright by Martin Clausen, Germany.
Contact the author: mc AT rotgradpsi DOT de