PICProg ISP
by Martin Clausen (mc AT rotgradpsi DOT de)
5 volt in system Flash-PIC-Programmer for connection via parallel port
Table of contents:
- Programming in target circuit without the need to remove the PIC.
- In target circuit only one 10 pin connector needed.
- Requires 5 volt only.
- Complete disconnection of programming signals, while PC does not access the PIC.
- Low part count
- Possibility to loop program for repeated programming.
- Program supports batch mode.
- Same software for 13 volt and 5 volt programming.
- Program is freeware for non-commercial use.
- 13V ISP version available
- Build ISP interface.
- Build your target circuit including the connector as shown in picprogprototype.gif.
- Write your program for the PIC.
- Connect the ISP interface with the target circuit.
- Start PICProg, load up and test your program. If you do find any errors, correct them and load the program up to the PIC again.
- Remove the connection between ISP interface and target circuit. Place at the connector of the target circuit 4 jumpers over pins 3-4; 5-6; 7-8; 9-10 at J3 / J4
See also this general overview.
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:
| /h | help
|
| /log | write output to picprog.log, forces /info
|
| /info | show full programming information
|
| /list | list of supported PIC
|
| /init2 | not for ISP
|
| /standby | loop program
|
| /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:
Error level | Message
|
|---|
| 0 | operation successful
|
| 1 | operation failed
|
| 2 | error in hex-file
|
| 3 | no programming to do, no file selected or no LPT selected
|
| 4 | fatal error
|
ID, configuration word and EEPROM data should be included in the hex-file at:
| Address | Memory Type
|
|---|
| 00000H - 01FFFH | program memory
|
| 02000H - 020FFH | ID, 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.
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.
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.
- Semiconductors:
- 1 74HC 4053
- 1 74HC 4066
- 1 74LS 14
Capacitors:
- 1 22µF / 16V axial
- 3 100nF cer
Resistors:
- 1 10k
- 1 10k*5 / 6 pin sil array
Mechanic:
- 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
- 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.
- Set parallel port to standard or EPP mode.
- Cable between PICProg and PC to long, keep it short as possible.
- Check if the logic chips (LS14, HC4053 and HC4066) are connected to the 5 volt power supply. These connections are not shown in the schematic.
- Also if the PIC can be programmed with less than 4.5 volt, the commands PICProg uses require a minimum supply voltage of 4.5 volt.
- 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.
- Be aware that the OSC pin must not have more than 72 osc clocks while /MCLR is switched. Remove clock or crystal if necessary.
- 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.
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)
Disclaimer: No warranty at all!
Copyright by Martin Clausen, Germany.
Contact the author: mc AT rotgradpsi DOT de
Impressum