Intro: Arduino ISP - LOG
Arduino ISP - LOG
So this Lazy Old Geek (LOG) has had a lot of trouble getting Arduino bootload on Atmega chips.
I couldn’t get either of these to work with Arduino UNO Rev3.
So I developed a couple that worked for me:
Problem: Well, my second Instructable works good for Atmega328s in a socket, but I have a Seeeduino that uses a SMD Atmega. So I can’t bootload it with my ICPs. See picture.
Solution: What many people may not realize is most of these Arduino In Circuit programmers use the same pins that are on the ICSP connector or sometimes called ISP.
ICSP: In-Circuit Serial Programming
Basically, this is a way of programming a microcontroller PCB through a connector.
ISP: In System Programming
Basically, the same thing. I don’t know the difference. They seem to be used interchangeably.
Step 1: ISP Cable
So I took my UNO ICP schematic and converted it to ICSP connectors. This makes it easier to hook up, then connecting six jumpers to various header pins on the Arduinos. See schematic
Construction: There’s a couple of ways to do this. You could take 2 2x6 female headers and solder wires or you can take six female-female adapter jumpers like these.
I used the second method.
Two Arduinos with ICSP/ISP connectors
6 f-f adapters
1 m-m adapter
Identifying pin 1 on ICSP/ISP connectors. These connectors are 2x3 male headers. See picture. Sometimes pin 1 is identified by a dot or a 1 or if you turn the Arduino over, pin 1 is square instead of round pad.
What I like to do is make sure by using a DMM and check which pin is connected to ground. This is pin 6 of the connector and pin 1 is the opposite. See pinout drawing.
For future reference, I mark pin 1 with red nail polish.
Now you have pin 1 identified on the two Arduinos. Identify one as the source Arduino. Source is the Arduino used to bootload the other Arduino, the Target.
Take one of the f-f adaptors and connect 1 to 1 on the two Arduino ICSP/ISP connectors.
Take another and connect 2-2, 3-3, 4-4 and 6-6
Take another f-f and connect one end to pin 5 on the Target Arduino.
On the other end, connect the m-m adapter, plug the other end into D10 female header of the Source.
See picture and schematic.
Then I wrapped both connectors with transparent tape to keep them bundled in order.
And I marked each Pin 1 with red nail polish. See picture.
Step 2: LED Indicator
(I apologize for the fuzzy pictures)
Using just the ISP cable, it’s a little harder to tell if it bootloaded correctly or not. So I built an LED indicator for success.
I used a 9 pin male header, a 1.2K ohm resistor and a green LED.
One side of the resistor is connected to header pin for A0, the other side to the positive side of the LED.
The negative side of the LED is connected to Ground.
TIP: It doesn’t matter whether the resistor or the LED is connected to A0. It does matter if the LED is connected backwards or not. Also the resistor value is not to critical. A smaller value will mean a brighter LED.
Technically speaking you don’t really need nine pins but I like to have the header extended all the way to the end of the row so it’s harder to put it in the wrong holes.
Another thing I did is: notice one pin sticks out between the two female headers on the Arduino. I bent the bottom of that pin so that it couldn’t be inserted into the wrong header hole. See last picture.
Step 3: Using Arduino ISP to ISP
Suggestion: So you may have noticed that the Target in the pictures has an Atmega328 in a DIP package. The reason I did this is so that if this process didn’t work then I could always take out the Atmega and re-bootload it in my other In Circuit Programmer.
Sketch code is attached in zip file.
Copy and unzip MTS_Optiloader.zip. Make sure the directory contains MTS_Optiloader.ino and three other files.
Plug USB into the Source Arduino which is connected to the Target Arduino.
Power LEDs on both should be on. (Power and ground for the Target is supplied through the ISP cable)
Upload MTS_Optiloader to the Source. This takes a while.
Now if you built the optional Green LED assembly, if the Green LED is lit, that means the Bootload was successful.
If you didn’t build the assembly, what I like to do is open the Arduino serial monitor and set it for 19,200 baud.
Type a ‘G’ and the bootload will run again. The screen will display the success or failure to burn it correctly.
Conclusion: So after being able to Bootload the Duemilanove, I hooked up my Seeedunio and was able to Bootload it also.
Some of you may think why did I write an Instructable to just bootload one Arduino? Well, actually, I have plans for using this setup in future projects. For now, I can throw the cable and the LED indicator in a bag with the schematic.