by Martin Clausen (mc AT rotgradpsi DOT de)
Flash-PIC-Programmer for connection via parallel port
Table of contents:
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]
- Complete shutdown of signals and power supply, while PC does not access the PIC.
- Low part count
- Possibility to loop program for repeated programming
- Program supports batch mode.
- Program is freeware for non-commercial use.
- 5V ISP version available
|/log||write output to picprog.log, forces /info
|/info||show full programming information
|/list||list of supported PIC
|/init2||use /MCLR before Vpp power-up mode
|/continue||continue programming also while errors occur
|/noF84||blocks PIC16F84 mode
|/lptX||definition of parallel port
|/read||data transfer from pic to file, reverses /w: command
|/compare||data 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:
|2||error in hex-file
|3||no programming to do, no file selected or no LPT selected
ID, configuration word and EEPROM data should be included in the hex-file at:
|00000H - 01FFFH||program memory
|02000H - 020FFH||ID, configuration word
Here an example by Thorsten Klose to make this clearer:
This program recognises the following PICs:
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.
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.
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.
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.
- 1 1N 4001
- 1 1N 4148
- 1 BC 547
- 1 74HC 4066
- 1 74LS 14
- 1 78L05
- 1 TL317 or LM317L (TO-92 case)
- 1 100µF / 25V axial
- 1 22µF / 16V axial
- 6 100nF cer
- 1 470
- 1 4.7k
- 4 10k
- 1 10k*5 / 6 pin sil array
- 1 sub-D socket, 25 pin
- 1 cable, sub-D plug-plug, 25 pin
- 1 case
- 1 pbc, about 50 mm * 70 mm
- 1 some thin wire
- 2 sockets for low voltage power connector
- 3 sockets 40 pin
- 3 sockets 18 pin
- 6 screws M3, 20 mm
- 2 screws M3, 8 mm
- 4 distance bolts, 8 mm
- 6 nuts M3
- Check status messages and parameters.
- Hex-file defect, especially only CF or LF instead of both at line end
- In the hex-file unimplemented bits maybe set or reset, while reading them back from the PIC will give opposite value. This will cause PICProg to report an error, but all implemented bits are programmed without an error. This is especially important for the configuration word of files for C7X that are programmed into F7X.
- Set parallel port to standard or EPP mode.
- Cable between PICProg and PC to long, keep it short as possible.
- Do not replace LS by HC or HC by CMOS.
- Check if the logic chips (LS14 and HC4066) are connected to the 5 volt power supply. These connections are not shown in the schematic.
- Use decoupling capacitors (100nF cer) at each chip. They are not shown all in the schematic. Place them as close as possible to the chips.
- Check the stability of your power supply.
- Check voltages during programming at the 40 pin socket:
- Pin 39 and 40 - signal with TTL level
- Pin 1 - 13 volt
- Pin 11 and 32 - 5 volt
- Pin 8, 12 and 31 - 0 volt
- Check voltages after programming: all less than 0.3 Volt, except pin 1, there less than 0.9 volt
- To improve the signal levels 10K resistors can be connected from pin 6, 8, 10 and 12 of U10 (one resistor each pin) to 5 volt.
- Ringing on the clock line may lead to occasionally programming failure. Insert a 56 ohm series termination after the inverter and a 22pf capacitor after the termination on the pin of the PIC to ground.
- picprog.zip program V2.3 with picdata.dat
- picprogsource.zip source code of the program (for Power Basic 3.20)
- Use for PIC12F629/16F630/12F675/16F676 /init2 and check that /MCLR gets close to 0V, or use mclre_on with those chips.
- Do not use ID locations on PIC16F818/F819 or programming will fail there.
- picprog2.gif circuit V1.12, low programming current, good protection for PIC if inserted wrong way around, not for PIC16F7X
- picprog.gif circuit V1.12, in case of problems, check if /MCLR goes down to at least 0.8V, you may add to D5 in series another 1N4148 or a BAT42
- picbatch.bat batch mode support by Zoltan Toth
- picpcb109.zip pcb by Jhankar Nathvani in Protel, for circuit V1.09, with bugfix for Vpp source in readme.txt
- recal.zip program V0.10 with source code (for Power Basic 3.20), write oscilator calibration value to 12F629; 12F675; 16F630; 16F676 Use with care!
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:
- the results of you investigations about the under the topic possible causes of errors mentioned issues
- all status information, that are displayed during the programming process, use therefore the /log option
- the PICProg type you use (5V-ISP or 13V)
|IC-Prog Universal-Serial-Programmer with Windows software||Bonny 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