by Martin Clausen (mc AT rotgradpsi DOT de)

5 volt in system Flash-PIC-Programmer for connection via parallel port

Table of contents:


Development cycle employing PICProg ISP

See also this general overview.

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
/init2not for ISP
/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

Do not forget that in LVP mode RB3 at PIC16F87X / RB4 at PIC16F62X is not available as a general purpose pin. This is caused by internals of the PIC and there is no work around to free this pin.

Do not ever write a zero to the LVP bit in the configuration word, because it will disable 5 volt programming.

If the LVP bit has been set to zero or you need RB3 / RB4, you can use the 13V PICProg.

You cannot to use PICProg for ISP below 4.5 volt.

Supported PICs

This program recognises all in ISP mode supported PICs:

16F87; 16F88
16F627; 16F627A; 16F628; 16F628A; 16F628A REV2; 16LF627; 16LF628; 16F648A
16F818; 16F819
16F870; 16F871; 16F872; 16F873; 16F873A; 16F874; 16F874A; 16F876; 16F876A; 16F877; 16F877A

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

Target Circuit Connection

The circuit is supplied by the target circuit. Three CMOS switches of the 74HC4053 are used to switch pins of the PIC between the target circuit and the programming circuit. A CMOS switch of the 4000 series would have had a to high on resistance. But still there is a difference between the usage of straight connections and the programming adapter. High speed signals should not be transmitted through RB6 and RB7.

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.
CMOS switch U7,4 and R4 behave together like an inverter. 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.


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:

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