loading

This instructable adds to any of the Arduino on a Breadboard instructables. I wrote my own breadboard-Arduino tutorial, and then I found that I was struggling to program some of the boards I made. A lot of research and dead-ends got me understanding that:

1. You either need a microcontroller with a pre-loaded Bootloader, or must load your own
2. Not all ATmega328’s are equal

(A bootloader, very simply, is a programme that sits on the chip and manages the upload of your sketches onto the chip)

There are plenty of bootloading resources, but I couldn’t find a single one that pulled everything together in a way that made sense to me.

If this instructable helped you, please visit Crash Bang Prototyping, follow us on twitter, and join in with our prototyping resources and tools.

Here goes…

Step 1: Parts

1 x Arduino on a Breadboard
1 x Arduino UNO
Connecting Wires
Arduino IDE installed on your PC

<p>Thanks a lot</p>
<p>thanks for info !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p>
<p>IT WORKED!!!</p>
Great stuff - thanks for letting me know! Would love it if you followed <a href="https://twitter.com/crashbang_proto" rel="nofollow">Crash-Bang on Twitter </a>as a thanks :)
Thanks for this. Helped me save a wasted ATmega328
Excellent, pleased it helped! Thanks for letting me know.
<p>Thanks a lot. This works perfectly..</p>
<p>avrdude: Yikes! Invalid device signature.</p><p>Double check connections and try again, or use -F to override</p><p>this check. I am still getting the same problem again and again even i tried every step mention above with 2/3 affected ATMega328P-Pu IC. Please tell me what to do now?</p>
<p>avrdude: Yikes! Invalid device signature.</p><p>Double check connections and try again, or use -F to override</p><p>this check. I am still getting the same problem again and again even i tried every step mention above with 2/3 affected ATMega328P-Pu IC. Please tell me what to do now?</p>
<p>I used this tutorial to build my own atmega based system and so i ordered a bunch of Atmegas from retail seller. All i had were 10 and 47 pF capacitors and so i used them for oscillator. I have struggled for days with avrdude: stk500_getsync(): not in sync: resp=0x00 message and after running out of ideas i went to parts store today and bought exactly 22pF capacitors. Imagine, it worked like a charm. Thank you!</p>
<p>Great! I've often wondered about, but never tested, the tolerance on the capacitors... good to know the datasheet doesn't lie :)</p>
<p>Tried all the methods. Spent a few hours working on it. Then I discovered that my UNO was responding only to the older version of the IDE. It refused to upload in the newer IDE. After discovering this, I tried it in the older IDE. Worked like a charm. Bootloaded 2 chips and also uploaded blink programmes.</p><p>Thank You so much for this tutorial!</p>
<p>U r a life saver. Thank a lot</p>
<p>Thank you so much. This finally solved my problem after hours of work!!!</p>
<p>My ATMega328 is running the internal clock at 8 MHz. I successfully installed the bootloader but can't communicate via the UART (FT230X SCI to USB circuit). I've used the circuit successfully many times before, so I don't suspect the hardware. Since the baud rate for the communications from the ATMega is derived from the system clock, I suspect the bootloader is expecting a 16 MHz crystal and is setting an incorrect baud rate (I had to modify the bootloader code and set it to an internal clock on the fuse register). Does anyone have access to the source code for the hex bootloader that is sent to the microcontroller? Any other ideas?</p>
<p>When I change the signature to the ATMEGA328-PU, my code compiles and uploads fine. However, the code runs very slow. PWM LEDs become a visible flicker. I'm using an external 16MHz clock. Circuit and code works fine with a ATMEGA328P-PU.</p>
<p>God Bless u. U r a life saver. </p><p>Thanks a lot</p>
<p>Hey everyone, Here's a permanent way to fix the programming issue with ATMEL328 and still keep your UNO (ATMEL328P) programmable. You want the ATMEL328 device signature to be a Diecimila. However, the Boards.txt file included with the standard copy of Arduino (1.6.3) has a typo, which you will have to fix if you want to seamlessly program your Diecimila with ATMEL 328 instead of ATMEL 328P. Here's how you do it:</p><p>1. Find your Arduino Application</p><p>2. Go to Java, then hardware, then arduino, then avr, then find &quot;boards.txt&quot;</p><p>3. Make a copy of &quot;boards.txt&quot; in case you mess up</p><p>4. Find the line in &quot;boards.txt&quot; that says:</p><p>diecimila.menu.cpu.atmega328.build.mcu=atmega328p</p><p>5. Backspace the &quot;p&quot; off of the line so it looks like this:</p><p>diecimila.menu.cpu.atmega328.build.mcu=atmega328</p><p>6. save the txt file, restart Arduino, and you're Done!</p>
<p>Please note: Using this method will not allow you to simply plug the ATMEL328 into an old UNO shield and have it programmable via the USB cable. You will have to use a number of workarounds or program via ISP. It is possible to make your own board profile if you really want to do this, but chances are the ATMEL328 is destined for something other than a regular Arduino board.</p>
<p>Hey everyone, Here's a permanent way to fix the programming issue with ATMEL328 and still keep your UNO (ATMEL328P) programmable. You want the ATMEL328 device signature to be a Diecimila. However, the Boards.txt file included with the standard copy of Arduino (1.6.3) has a typo, which you will have to fix if you want to seamlessly program your Diecimila with ATMEL 328 instead of ATMEL 328P. Here's how you do it:</p><p>1. Find your Arduino Application</p><p>2. Go to Java, then hardware, then arduino, then avr, then find &quot;boards.txt&quot;</p><p>3. Make a copy of &quot;boards.txt&quot; in case you mess up</p><p>4. Find the line in &quot;boards.txt&quot; that says:</p><p>diecimila.menu.cpu.atmega328.build.mcu=atmega328p</p><p>5. Backspace the &quot;p&quot; off of the line so it looks like this:</p><p>diecimila.menu.cpu.atmega328.build.mcu=atmega328</p><p>6. save the txt file, restart Arduino, and you're Done!</p>
<p>The reason why you can't program an ATMEL 328 inside of an UNO shield is because the avrdude.config for Diecimila doesn't match exactly what the UNO layout is. The ATMEL 328 is better off bare-bones or some other custom layout.</p>
<p>Please note: I haven't been able to make the ATMEL 328 in an UNO shield be programmable via a USB cable using this technique, but it will save you some trouble when programming via ISP (MOSI, CLK, and MISO) so that you do not have to change the device signature of your UNO ATMEL 328P.</p>
<p>Thank you. It works</p>
Hi,<br><br>I have an atmega328p MLF package type that's mounted on a pcb with crystal (SMD Type) and other few components. <br><br>How to upload code to this ?
<p>Hi</p><p>It may have an ISP header? Can you send a link to the product you have?</p><p>Cheers</p><p>Andrew</p>
<p>my softwear are not working</p>
<p>I can't save F0. it is showing this error message. now what to do? please help........</p>
<p>Wow - that's an error I've never seen before. Can you give me more info on what you were doing when it happened? Looks like some kind of security rights issue.</p>
<p>actually I have done all the job but it is showing the same problem.Nothing new is showing. And inside the &quot;etc&quot; folder there already have &ldquo;<em>0x1e 0x95 0x14</em>&rdquo; sooooooo what to do now ?</p>
<p>The bootload of my arduino has been corrupted. Through this tutorial I've fixed it, especially with the STEP6.</p><p>Thank you so much for sharing your experience</p><p>Michael</p>
<p>Awesome - thanks for letting me know - really pleased it helped</p>
<p>Perhaps a better, more permanent solution: if you buy a lot of these chips is to edit avrdude.conf and add the following below the part parent &quot;m328&quot; section:</p>part parent &quot;m328&quot; id = &quot;m328pu&quot;; desc = &quot;ATmega328PU&quot;; signature = 0x1e 0x95 0x14; ocdrev = 1;<p>This should permanently add the 328PU to your supported parts for avrdude.</p>
<p>Hi JPS2 ... I would prefer this permanent solution but I have not been able to make it work. I get a &quot;syntax error&quot; at the line I have the &quot;part parent&quot; instruction. Any suggestion?</p>
<p>Thanks for the suggestion. When I originally wrote this, the GCC toolchain didn't support the m328, so while AVRDude would upload ok, the sketch wouldn't compile. I understand this has changed with the latest releases of GCC - I need to test it out and amend the Instructable as soon as I have a chance.</p><p>Thanks for the post.</p>
<p>thanks a lot!</p>
<p>I have the ATmega328 with Arduino Bootloader (<b>http://tinyurl.com/o4n9cxe). I do not have the 16MHz crystal and so im using the minimun circuit wiring setup to upload sketches (</b>http://arduino.cc/en/Tutorial/ArduinoToBreadboard). but it does not work when i try to upload on a breadboard. </p>
<p>It's likely that the ATmega you bought is configured to work with a crystal. ATmegas have &quot;fuses&quot; that can be set to configure where the system clock is sourced from. It's likely that the one you bought has the fuses set for an external 16MHz crystal, as that's what teh Arduino uses. If you have an Arduino UNO, try switching the new microcontroller out for the existing one.</p>
<p>Hey thanks man... This is a great help to me. I had an ATMEGA 328-PU and I was in problem of burning bootloader. This is working. Thanks a lot.... </p>
<p>Excellent! Pleased it helped and salvaged your 328-PU chips!</p>
<p>1) Uploading sketches in such a way (with the bootloading way) does mean that the bootloader will be erased after uploading a sketch, doesn't it? We just do that for fuses etc?? Could we upload a sketch without before burning the bootloader on our (breadboard) chip? </p><p>2) Using FTDI u mean w remove the chip from the Arduino Uno and programming via Rx and Tx pins, remaining/leaving the same &quot;Arduino on a breadboard&quot; circuit as it is?</p>
<p>Hi,<br>@AndyTallack just to say that on linux, the &quot;avrdude.conf&quot; file is located in &quot;/etc/avrdude.conf&quot; (at least that is the case for linux mint 17 &quot;Qiana&quot;). You might want to add this information to your tutorial ; I am sure linux users would appreciate that.<br>Everything else works as expected.<br>Thanks for the tutorial !<br>Cheers,<br>G. Lorieul</p>
<p>Great, thanks - will include when I get a gap.</p><p>Thanks for the info!</p>
It didn't worked fr me I''m using atmega 328-pu
Sorry to hear that - can you give me more info?
It didn't worked fr me I''m using atmega 328-pu
<p>If swapping back and forth gets annoying then you can just copy the entire section to a new one, give it an id of &quot;m328pu&quot; and a description of &quot;ATMEGA328PU&quot; with the appropriate fuse values. You can then edit your Arduino IDE &quot;boards.txt&quot; file and create a new board based on the Uno one with the mcu set to &quot;atmega328pu&quot;. You'll then be able to select that device in your IDE Board list in addition to the regular Uno board.</p>
Thanks Mark. I had tried that originally, but the GCC toolchain (as I understood) didn't support it. What version of the IDE are you using? I believe the new GCC toolchain now supports but haven't had a chance to test yet.
<p>Plz help me Sir, I have modified the conf file. But now on hitting arduinoisp, it says 'Expected signature for ATMEGA328P is 1E 95 14'.</p>
Hi<br><br>Does it tell you what the actual signature is? <br><br>Are you sure it is an ATmega328?

About This Instructable

165,481views

181favorites

License:

Bio: I’m not a rocket scientist. I don’t have a master’s degree in Electrical Engineering. I love automating, hacking, robotics, creating, building, understanding ... More »
More by AndyTallack:Bootload an ATmega328 BaW-Bot Part 3: Adding Sight and Touch to the Bot BaW-Bot Part 2: Build the motor-controller & body 
Add instructable to: