I have an arduino unu (pre-made) with the atmega328 and an atmega168. I am wanting to make a second arduino out of the 168. I don't have a USB programmer. The chip came out of some servo contorller board so I am guessing the arduino bootloader is not already installed. Is it possible to program with my uno, and if so how? Connection to the arduino instead of the computer when sending sketches is fine as long as I can disconnect it from the uno for use.
5 Answers
You can use an Arduino as a programmer for other chips. The sketch is called "ArduinoISP".
See these pages: http://arduino.cc/en/Tutorial/ArduinoISP, and http://arduino.cc/en/Tutorial/ArduinoToBreadboard
Basically, you power the target processor and connect to its in circuit programming programming pins.
For a AtMega168 select the board type of "Arduino Diecimila or Duemilanove w/ ATmega168" as the target.
Here is one important tip. You have to disable the auto-reset of the programmer that occurs when the serial port is opened. Do this right before you select "Burn BootLoader" in the IDE. I have seen putting a specific pullup value on it as well as a big cap on the reset line. I had a breadboard Arduino so I just disconnected the reset line.
-
-
\$\begingroup\$ Depends on the fuses of the chip you want to program. Factory default ATmega has its internal clock oscillator enabled and you won't need an external clock. \$\endgroup\$– jippieCommented Jul 24, 2013 at 6:37
-
\$\begingroup\$ When I tried to send it, it said this:avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check. \$\endgroup\$– skylerCommented Jul 24, 2013 at 15:42
-
\$\begingroup\$ For the "-f to override", where do I put the -f? \$\endgroup\$– skylerCommented Jul 24, 2013 at 16:07
You need to program it with the corresponding version of bootloader to match the 168 or 328 chips. The IDE will select the corresponding bootloader as specified per the
.\arduino-1.5.2\hardware\arduino\avr\boards.txt.
If you program using the ISCP then for a UNO it would get
.\arduino-1.5.2\hardware\arduino\avr\bootloaders\atmega\ATmegaBOOT_168_atmega328.hex
where the 168 would use
.\ATmegaBOOT_168_diecimila.hex
in the same directory.
You may also wish to use other compatible bootloaders such as optiboot
.\arduino-1.5.2\hardware\arduino\avr\bootloaders\optiboot
-
\$\begingroup\$ I am confused where I enter in all of the file locations. do I do it in the serial port? All I see is "burn bootloader" not "select chip that you are going to burn your bootloader on" \$\endgroup\$– skylerCommented Jul 24, 2013 at 16:04
i'm posting this incase there's somebody who'd be as desperate as i am to get an old s3v3 to work using an arduino uno hooked up to a pc. been at this thing for months, and just can't imagine how frustrating it was. my main objective was to bootload the old s3v3 with a new uno i had for a few months, then upload a blink sketch. i basically followed the steps from these two sites over and over. apparently the board selection just made all this work, and i think my s3v3 had a corrupted bootloader or something.
http://arduino.cc/en/Tutorial/ArduinoISP
http://arduino.cc/en/Tutorial/ArduinoToBreadboard
pin connections;
uno === s3v3
5v === 5v
gnd --- gnd
d10 --- reset
d11 --- d11
d12 --- d12
d13 --- d13
procedures; (im using arduino ide 1.0.1)
-load the arduinoISP program from samples into the uno.
-after loading the arduinoISP sketch, set this:
tools > programmer > arduino as isp
tools > board > arduino nano w/ atmega168. <---this was a eureka moment.
-then click on tools > burn bootloader
-after the bootload is done, open the target sketch,
-setup some kind of indicator, like blink, etc. (i setup a blink function on pin 9, so i'd know the upload worked.)
-click on file > upload using programmer.
I've tried numerous troubleshootings from various sites, including the tip to put the uno board's reset to low using a ceramic cap, nothing just worked. i was almost giving up into buying another board, until the setting just worked. 0_o
-
1\$\begingroup\$ Does this answer the original question? If so you should probably clarify the parts that will be helpful to the original poster. There are also a number of formatting tools that would improve how your answer reads. \$\endgroup\$– DavidCommented Jul 23, 2014 at 6:24
There is an easier way to do this. I just have bootloaded atmega 168-20PU with arduino uno. I used old IDE Ver1.05. I tryed to bootload it with Tools/Board>Uno, and it gave a Yikes!Invalid device signature, and so i started with different board settings going from Arduino BT w/ ATmega168, and it did not worked, then to Arduino Mini w/ ATmega 168, and finally the one that worked for me was Decimila od Duemilanove w/ATmega168. Bootloaded successfully.
Invalid device signature: change the Device Signature in the "...\arduino-1.8.5\hardware\tools\avr\etc\avrdude.conf". Search for "168" and change the last"0x06" in a "0x0b" in the signature line "signature = 0x1e 0x94 0x06". After this procedure I was able to burn the bootloader and writing sketches into my ATmega168P by using "Duemilanove/Diecimila" as target.
To show the expected signature vs. the right signature during upload goto File -> Preferences and set check box "verbose output during upload".