Introduction: Arduino ICSP Programming Cable
Here is how I like to make an Arduino ICSP programming cable, to use for bootloading or programming.
Step 1: Supplies
The supplies are Dupont jumpers, capacitor, glue, and heat shrink tubing.
Step 2: Target End
Start with 6 female-to-female Dupont jumpers that are still in a ribbon, have not been zipped apart. And 1 male-to-male jumper. Work on the target end of the programmer cable. Arrange the connectors into 2 rows of 3 pins each pattern, that will plug into the ICSP header on an Arduino.
D12 MISO 1 . . 2 VCC D13 SCK 3 . . 4 MOSI D11 RST 5 . . 6 GND
Put a small dob of glue between the connectors, and put a small piece of heat shrink tubing over the assembly and shrink it. There is not much glue needed for this, just enough to keep the connectors from slipping around after full assembly. After shrinking the tubing, press the connectors flat against the table so there aren't any that are sticking out or uneven.
Step 3: Remove Plastic Shell From Programmer End GND Wire
Look at the target end and the colors used for the GND and RST pins. In this case, purple for RST, and black for GND. On the programmer end, remove the plastic shell from the GND pin, and remove the plastic shell from an extra Dupont wire end. There is a tab on the shell to gently pry, and the shell will come off.
Step 4: Solder Capacitor to Connectors and Re-install Shells
Use locking forceps to clamp wires in place and to act as a heatsink to protect the wire insulation, and solder a capacitor to the connectors. Use a very small amount of solder, to keep it from wicking into the pin receptacle, which would prevent it from sliding onto the ICSP header on the Arduino.
Cut the wire off of the extra Dupont wire connector we are putting the in the RST position of the completed connector end. Push the connectors back into the shells using a pin. This took some extra force to get the shell on, because the solder and capacitor wire made the connector a little thicker. After putting the plastic shells back on, I realize next time I should make the wires on the capacitor slightly longer, by perhaps another 1/8 to 1/4 inch. The + side of the capacitor is connected to the extra pin, which is intended for the RST position of the completed connector. The - side of the capacitor is connected to the black GND pin.
A capacitor of several uF is fine, I used 33uF. 10uF would have been fine, but my 33uF capacitors were smaller than the 10uF capacitors I had on hand.
Step 5: Arrange, Glue, and Heat Shrink Connectors
Arrange the connectors to match color-for-color the target end. The bottom left connector is the reset wire. On the ICSP header this is pin 5. Leave the RST wire that comes from the target side connector out of the arrangement of pins on the programmer side, and replace it with your cut off connector that has the capacitor attached. Glue, heat shrink, and make the pins uniform and even as in the target-end step. Use a slightly longer piece of heat shrink tubing on the programmer end, to partially contain the capacitor.
Step 6: Add Male Jumper Wire Connector for the Reset Signal and Mark Pin 1
Cut a male-to-male jumper and use a solder connection and heat shrink tubing, to attach it onto the reset wire that goes to the target side of the cable.
The upper left pin of each connector is pin 1 of the ICSP header on your Arduino. Mark it with a spot of paint. I used a white Gelly Roll paint pen. That's it, the cable is complete.
Step 7: Plug It In
The programmer Arduino is the one loaded with the Arduino as ISP sketch. It gets the programmer end of the cable, plugged in with pin 1 in the upper left corner. The Arduino also has pin 1 marked with a little dot. The reset wire plugs into D10.
The target end of the cable plugs into the Arduino we are going to bootload or program.
Most Arduinos have a little dot near the ICSP header to mark pin 1. If yours doesn't, or if it is not very obvious, now would be a good time to add a little dot while you have the paint or paint pen handy. Here is a picture of an Arduino of mine where I added the dot. On the ATmega16u2 usb-to-serial chip ICSP header that is arranged horizontally near the upper left corner of UNO or MEGA, pin 1 is in the upper right corner of that connector.
Step 8: Another Programming Cable for Pro Mini and Pro Micro
I also like Pro Mini and Pro Micro quite a lot. Those are boards invented by Sparkfun that are practically pin and footprint compatible. Pro Mini has ATmega328p MCU like the UNO and Pro Micro has ATmega32u4 like the Leonardo. I like to use them as programmers, and to program or bootload them via ICSP. So, here are the supplies for making an ICSP cable: female header, female Dupont jumpers, capacitor, and heat shrink tubing.
Cut the headers to the right length to fit on all of the pins on one side of the Pro Mini or Pro Micro. Cut in the middle of the first unused pin of a long header strip. All it takes is a little pressure with some diagonal cutters, and it will break apart. Then use the diagonal cutters to trim the excess plastic from the pin position destroyed when cutting the header. The result is a 12 position header with nice trimmed ends. To get fancy, sand the ends.
Step 9: Remove Plastic Dupont Shells
Remove the plastic shells from the ends of the Dupont jumpers. Notice a little tab on the shell. Pry the tab up gently and pull the plastic shell off.
Step 10: Add Heat Shrink Tubing and Push Connectors on the Female Header in Correct Positions
Slip the heat shrink tubing onto the wires. Push the connectors onto the female header solder pins. This takes a steady hand and dexterity. The wires go from MOSI, MISO, SCK, VCC, and GND on one header to the other header. The reset wire goes from pin 10 on the programmer Arduino, to the reset pin of the target Arduino.
The designers of Pro Micro were clever when they decided the pin layout. Although the pins are arranged
10, 16, 14, 15
and that seems to be nonsense, it happens to correspond to the pin functions of the Pro Mini pins
10, 11, 12, 13
The order is:
reset-sender, MOSI, MISO, SCK, on both Pro Mini and Pro Micro.
So, you will be able to use this cable with a Pro Mini or Pro Micro as the programmer, and with Pro Mini or Pro Micro as the target.
Step 11: Solder the Pins
Use locking forceps to hold the pins steady, evenly spaced, and straight. The forceps also act as a heat sink that prevents the solder heat from traveling up the wire and melting the insulation or prematurely shrinking the heat shrink tubing. Solder each pin quickly, and don't use an overabundance of solder. Use just enough to get the job done.
Add a capacitor between GND and RST on the programmer-side header, to disable reset from the FTDI adapter's DTR pin. Several uF is fine, I used 33uF. 10uF would be fine, but my 33uF capacitors were smaller than the 10uF capacitors I had on hand. Solder the + side of the capacitor as close as possible to the header plastic so the heat shrink tubing covers as much as possible. I made a small slit near the end of the heat shrink tubing for the capacitor's wire to go through.
Finally, slide the heat shrink tubing up the wire onto the connector until it meets the header plastic, and shrink the tubing with a heat gun.
Step 12: Done
Here is the finished cable. Use a label maker to mark which end of the cable is for the programmer and which end is for the target. And mark which end of the header should point towards the USB side of the Pro Mini's FTDI adapter or the built-in USB of the Pro Micro.