Introduction: JDM2 Based PIC Programmer
Schematic & layout for an updated JDM2 PIC Programmer. Includes clock & data filter, Vpp voltage divider for modern PIC microcontrollers (eg USB PIC 18F2455/4455).
Prior to reading sites like www.hackaday.com & www.makezine.com/blog I had worked only with the Amtel/AVR line of microcontrollers. After seeing all the cool projects people were doing with Microchip PICs, I HAD to have a PIC programmer. About a year ago I made my first PIC programmer based on the uJDM design (http://www.jdm.homepage.dk/newpic3.htm ). This programmer uses 6 common components. Though the link says '16F84(a)' only, I used it for the more modern (and cheaper) 16F628(a) processors without problems. This programmer has served me extremely well, but it is limited to (less than) 18 pin PICs with a programming Vpp of 13 volts.
This 'instructable' covers my new design that programs 8/14/18/28/40 pin PICs. The circuit is based on the JDM2 programmer (http://jdm.homepage.dk/newpic.htm ), with two enhancements: clock and data line filtering & selectable programming voltage.
The ZIP archive contains all the project files. The uJDM schematic and layout are included as well.
Prior to reading sites like www.hackaday.com & www.makezine.com/blog I had worked only with the Amtel/AVR line of microcontrollers. After seeing all the cool projects people were doing with Microchip PICs, I HAD to have a PIC programmer. About a year ago I made my first PIC programmer based on the uJDM design (http://www.jdm.homepage.dk/newpic3.htm ). This programmer uses 6 common components. Though the link says '16F84(a)' only, I used it for the more modern (and cheaper) 16F628(a) processors without problems. This programmer has served me extremely well, but it is limited to (less than) 18 pin PICs with a programming Vpp of 13 volts.
This 'instructable' covers my new design that programs 8/14/18/28/40 pin PICs. The circuit is based on the JDM2 programmer (http://jdm.homepage.dk/newpic.htm ), with two enhancements: clock and data line filtering & selectable programming voltage.
The ZIP archive contains all the project files. The uJDM schematic and layout are included as well.
Step 1: Design Enhancements
Clock and Data Filter:
Newer PICs are programmed so fast that the clock and data lines can experience cross-talk. According to the author of WinPic programming software(http://www.qsl.net/dl4yhf/winpic/ ):
"There was a note on the Microchip forum (by Olin Lathrop) about programming the dsPIC30F201, suggesting to put 22..47 pF on the PGD and PGC lines to ground near the target chip. In addition, put a 100 ohm resistor in series with the PGD line between target chip and the cap. The resistor and cap on the PGD line low pass filter the PGD signal when it is driven by the target chip. This reduces the high frequencies that can couple onto the PGC line. The cap on the PGC line makes it less suceptible to coupled noise. We later found out that this important note also applies to the PIC18Fxxxx family. A user of a Velleman PIC programmer reported success with a PIC18F4520 after adding 2 * 33 pF caps and a 100 Ohm series resistor." (LINK:http://www.qsl.net/dl4yhf/winpic/#pgd_pgc_filtering )
This note applies primarily to programming PICs through a cable while they are soldered into a circuit. When using this type of programming the extra capacitors and resistor must be near the target chip - it does not help to have them on the programmer:
"This means that this problem can not be solved at the programmer end of the cable. No amount of clever circuitry at the programmer can make this issue go away. It must be dealt with at the target circuit. (LINK: see PGD to PGC Crosstalk at http://www.embedinc.com/picprg/icsp.htm )
I emphasize this so it is clear you CANNOT slap a ICSP header on this board without issue. I included the filters in my new programmer because the data/clock traces are long. The capacitors are situated in the circuit so that they can be excluded without weakening the trace. The resistor can be replaced with a jumper wire.
Selectable Programming Voltage (Vpp):
Programming voltage (Vpp) is applied to the MCLR pin to place the PIC in programming mode. Older PICs (12F/16F/some 18Fs) require a Vpp of 13 volts. Newer PICs (such as the USB enabled 18F2455/4455) have a lower Vpp of 12.5 volts. A voltage divider was added to the JDM2 design to provide 12.5 volts from the original 13 volt output. A diode prevents leakage through the voltage divider when it is bypassed. Vpp is selectable by the three pin jumper at the lower left of the programmer. In practice it doesn't seem to matter: I can program 13 volt parts with 12.5 volts, and 12.5 volt parts at 13 volts without damage.
Newer PICs are programmed so fast that the clock and data lines can experience cross-talk. According to the author of WinPic programming software(http://www.qsl.net/dl4yhf/winpic/ ):
"There was a note on the Microchip forum (by Olin Lathrop) about programming the dsPIC30F201, suggesting to put 22..47 pF on the PGD and PGC lines to ground near the target chip. In addition, put a 100 ohm resistor in series with the PGD line between target chip and the cap. The resistor and cap on the PGD line low pass filter the PGD signal when it is driven by the target chip. This reduces the high frequencies that can couple onto the PGC line. The cap on the PGC line makes it less suceptible to coupled noise. We later found out that this important note also applies to the PIC18Fxxxx family. A user of a Velleman PIC programmer reported success with a PIC18F4520 after adding 2 * 33 pF caps and a 100 Ohm series resistor." (LINK:http://www.qsl.net/dl4yhf/winpic/#pgd_pgc_filtering )
This note applies primarily to programming PICs through a cable while they are soldered into a circuit. When using this type of programming the extra capacitors and resistor must be near the target chip - it does not help to have them on the programmer:
"This means that this problem can not be solved at the programmer end of the cable. No amount of clever circuitry at the programmer can make this issue go away. It must be dealt with at the target circuit. (LINK: see PGD to PGC Crosstalk at http://www.embedinc.com/picprg/icsp.htm )
I emphasize this so it is clear you CANNOT slap a ICSP header on this board without issue. I included the filters in my new programmer because the data/clock traces are long. The capacitors are situated in the circuit so that they can be excluded without weakening the trace. The resistor can be replaced with a jumper wire.
Selectable Programming Voltage (Vpp):
Programming voltage (Vpp) is applied to the MCLR pin to place the PIC in programming mode. Older PICs (12F/16F/some 18Fs) require a Vpp of 13 volts. Newer PICs (such as the USB enabled 18F2455/4455) have a lower Vpp of 12.5 volts. A voltage divider was added to the JDM2 design to provide 12.5 volts from the original 13 volt output. A diode prevents leakage through the voltage divider when it is bypassed. Vpp is selectable by the three pin jumper at the lower left of the programmer. In practice it doesn't seem to matter: I can program 13 volt parts with 12.5 volts, and 12.5 volt parts at 13 volts without damage.
Step 2: Construction
The traces in this design are nice and fat for easy toner transfer (or lazy photo boards). I started making PCB with the TT method, but found it pretty tedious. A $10 investment got me started with photo PCBs (using ink jet transparency positives). I will never go back.
All the parts were available at my local electronics shop in Amsterdam, though I ordered the parts from Mouser in bulk. Each board cost about $2.50 to make - the greatest expense was the 9 pin female DB9 connector ($1.60).
Layout and BOM are below. Schematic and board files are for EagleCad. Don't forget the 8 jumpers, shown in red.
Part Value
C1 100uF/25V
C2 22u/16V Tantal
C3 22...47...100pf
C4 22...47...100pf
D1 1N4148
D2 5V1 Zener
D3 1N4148
D4 1N4148
D5 1N4148
D6 8V2 Zener
D7 1N4148
IC1 DIL18S
IC2 DIL28-3
IC3 DIL40
Q1 BC547B
Q2 BC547B
R1 10k
R2 1k5
R3 100ohm
R4 1K
R5 15K
SV3 Pin Header (3)
X1 Female DB9 9-pin connector (F09H)
All the parts were available at my local electronics shop in Amsterdam, though I ordered the parts from Mouser in bulk. Each board cost about $2.50 to make - the greatest expense was the 9 pin female DB9 connector ($1.60).
Layout and BOM are below. Schematic and board files are for EagleCad. Don't forget the 8 jumpers, shown in red.
Part Value
C1 100uF/25V
C2 22u/16V Tantal
C3 22...47...100pf
C4 22...47...100pf
D1 1N4148
D2 5V1 Zener
D3 1N4148
D4 1N4148
D5 1N4148
D6 8V2 Zener
D7 1N4148
IC1 DIL18S
IC2 DIL28-3
IC3 DIL40
Q1 BC547B
Q2 BC547B
R1 10k
R2 1k5
R3 100ohm
R4 1K
R5 15K
SV3 Pin Header (3)
X1 Female DB9 9-pin connector (F09H)
Step 3: USE
The programmer will work with any programming software that supports the JDM2. I like WinPic800 (LINK:http://perso.wanadoo.es/siscobf/winpic800.htm ), and WinPIC also deserves credit for the great technical support info (LINK:http://www.qsl.net/dl4yhf/winpic/ ). Both support the newest USB PICs (18F2/4455). ICProg is great, but has not been updated in some time (LINK:http://www.ic-prog.com/ ).
This programmer has been tested with the following PICs:
Pins Part #
8 12F683
14 16F684
18 16F84(a)*, 16F628(a)*
28 16F737, 18F2455
40 16F74, 18F4455
*Original and 'A' revision OK.
Placement for various PICs is show in the diagram below. It is not limited to these PICs - it should work with any PIC that has Vpp, Vss, Vdd, PGD, & PGC arrangements as shown.
This programmer has been tested with the following PICs:
Pins Part #
8 12F683
14 16F684
18 16F84(a)*, 16F628(a)*
28 16F737, 18F2455
40 16F74, 18F4455
*Original and 'A' revision OK.
Placement for various PICs is show in the diagram below. It is not limited to these PICs - it should work with any PIC that has Vpp, Vss, Vdd, PGD, & PGC arrangements as shown.
Attachments
Step 4: Future Improvements
I used cheap AMP IC sockets from Mouser because I had them on hand. My next design will replace the 28 and 40 pin sockets with one 40 pin ZIF socket. A little extra clearance around the 18 pin socket makes a ZIF substitution possible as well.
-ian
(instructables-at-whereisian-dot-com)
-ian
(instructables-at-whereisian-dot-com)