to try to get a standalone ATMega328 chip (with the external clock and capacitors) working on its own. I don't have a 10k resistor, so I've been using a 12k resistor instead. (I assumed that it wouldn't make much of a difference.) I managed to upload the ArduinoISP sketch onto my board without any issues, but when I run the bootloader (I'm pretty sure I've wired it up right, but I'll post pictures if requested), I get the following error message.
avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM3
Using Programmer : stk500v1
Overriding Baud Rate : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03
What does this indicate?
EDIT: I forgot to mention that I can't find the "Arduino Duemilanove or Nano w/ ATmega328" on the Tools > Board menu. I've looked at the board manager but I can't find the option there at all.
If not, that's the problem. You need to use an ISP programmer (can be another Arduino that's already working, or a USBAsp ($2 on ebay)) to put the bootloader onto the chip before you can upload using the bootloader - you connect up the ISP programmer (see abundant tutorials), and do burn bootloader from the IDE. Use the Uno bootloader, not the Duemillanove one - Optiboot is strictly better.
At a hardware level (these are important things that are not consistently specified in guides):
Do you have the 16mhz crystal and associated loading caps installed (note - sometimes on breadboard, you need to omit the loading caps - this is due to the stray capacitance in different models of breadboard)
Do you have the two 0.1uf capacitors (one between Vcc and Gnd, one between AVcc and Gnd) - these must be 0.1uf ceramic capacitors, and they must be located right next to the chip; otherwise, unpredictable failures can occur.
Do you have AVcc connected to Vcc? They must be connected, otherwise you can damage the chip.
How do you not have a 10k resistor? Search ebay for resistor and capacitor assortments - they're mindbogglingly cheap from chinese vendors.
I've already gotten past step 2 on this tutorial and set up the breadboard according to the picture:
So I'm going to use the "Arduino as ISP" option.
I'd like to get the standard bootloader working before I experiment with Optibooter.
I have all of the supporting hardware in place- the crystal and the two capacitors. I have ACC connected to VCC.
Will having a 12k resistor instead prevent it from functioning? I can get a bunch of resistors but I definitely won't have a 10k one for a while.
I think my problem is that, contrary to the tutorial's suggestions, I can't find the "Arduino Duemilanove or Nano w/ ATmega328" on the Tools > Board menu.
Is that error the output you get when doing burn bootloader, or the output you get when attempting to upload a sketch?
If you're seeing that doing burn bootloader, then Arduino as ISP is not set up correctly. Did you forget the cap between reset and ground on the Arduino you're using as programmer, to keep it from resetting when AVRdude opens the serial connection? ~10uf cap (really, anything vaguely close to 10uf should work) between Gnd and Rst.
You didn't directly answer my question about the decoupling caps (the 0.1uf cap between Vcc and Gnd, and AVcc and Gnd right next to the chip). The tutorial you linked incorrectly omits these caps - they are not optional - you will bring only pain by leaving them out. It's worse than them just making everything not work - because things may work under some conditions and not under others, and it depends on things like the length and geometry of the traces going to the power pins from the nearest filter cap on the supply as well as what the micro is (trying) to do, making debugging very hard. That's why it's one of the things I always remind people of - debugging something without knowing that it's got appropriate decoupling caps in place is a waste of time.
It's not just microcontrollers that need these - pretty much every digital IC needs a decoupling cap, 0.1uf unless datasheet says otherwise...
If you don't have 0.1uf caps, you need to get some anyway, since you need one between reset and the DTR pin of the external serial adapter (unless you're programming it over serial with another Arduino board instead of a serial adapter (in which case why make the Arduino on breadboard?) , or plan to only program it via ISP, not serial).
Also - the diagram in that tutorial has another problem. The crystal and it's caps should be next to the chip, not inches away halfway across the breadboard - that's begging for trouble. The wires going to crystals and their caps need to be short (same as the wires to decoupling caps).
DrAzzy:
How do you not have a 10k resistor? Search eBay for resistor and capacitor assortments - they're mind-bogglingly cheap from Chinese vendors.
True enough but let's be absolutely clear - the difference between 10k and 12k as the reset resistor is functionally irrelevant in this and most cases.
Do please read the instructions and it is vastly neater and more reliable to post not only code, but diagnostic output in "code" tags.
@Paul- that's exactly what I thought. Thank you for confirming it! I also edited my post a little to conform to the instructions.
@DrAzzy- I didn't even know I needed 10 uf caps, since I had been following that tutorial very strictly. Didn't know I couldn't trust it. I'll try what you said and post the results. But to clarify-
I am using the Arduino as an ISP
The error is the output when I burn the bootloader
When I put a cap between reset and ground- there are two ground pins on the Arduino. I am using one as a ground for the breadboard. Can I use the second ground pin for the cap between the reset and the ground?
How can I get "Arduino Duemilanove or Nano w/ ATmega328" on the Board menu? The stupid part is I searched the soruce code of the IDE, found boards.txt, and "Arduino Duemilanove or Nano w/ ATmega328" is actually on there. But I can't actually activate it for some reason.
Well, Ray’s link helped a ton. I’m using the minimal configuration now (the 8mhz one), and after adding the 10uf capacitor like DrAzzy said my ATMega now has a bootloader.
Two last things-
What are the downsides of running it at 8Mhz (i.e. what will I no longer be able to do vs running it at 60Mhz?)
Mr. Gammon’s guide has this image- http://www.gammon.com.au/images/Arduino/Minimal_Arduino21.png - where are the files for all of those boards? I went onto Arduino’s Github page and looked at the list of 3rd party boards, but I couldn’t find the ones in the picture at all. I particularly want the files for “Duemilanove with ATMega328” and “Nano with ATMega328”.
Do I need the 10uf capacitor when I load sketches on it?
Yeah, the official breadboard tutorial is really poor! A lot of stuff on the official site is, sadly...
8mhz vs 60mhz? Well at 8mhz it will run, at 60mhz, it won't even come close to it. I think the guys who used liquid nitrogen only got it up to mid 30's or low 40's (wish I'd taken notes...)
I assume you mean 8mhz vs 16mhz
The difference is that calculations will take twice as long. That may or may not be a problem for you - usually it isn't, but if you're doing something data/calculation intensive, it could be.
Those boards are included in the normal Arduino AVR boards package - you can find them in your hardware folder. I think in recent versions, they enhanced the menu, so like, you pick one option for the type of board, and then a submenu to select what chip is on it appears in the tools menu (this way it doesn't crap up the menu any more than necessary).
Whenever programming via ISP, the programmer needs a cap between Reset and Gnd.
DrAzzy:
...
8mhz vs 60mhz? Well at 8mhz it will run, at 60mhz, it won't even come close to it. I think the guys who used liquid nitrogen only got it up to mid 30's or low 40's (wish I'd taken notes...)
...
iirc some Russian guy got 65MHz out of an Arduino in LN2.
What are the downsides of running it at 8Mhz (i.e. what will I no longer be able to do vs running it at 16Mhz?)
What the Dr said + your uC will run longer on batteries at 8MHz (or lower.) Only you know if this is importand.
And, the frequency drift from ambient will be greater: just needs to be considered.
Lower build costs and a simpler layout. Check this out.