I recently ordered a bunch of Atmel Atmega chips, 328 to be precise and as soon as i got them i realised i was lacking some very important components to make these chips function. The 16mhz crystal and the two 22pf capacitors to accompany it. From previous knowledge of the Atmel chips i knew some of them contained internal clocks, i hoped that the atmega did to. After some research i found it was possible to run an atmega completely on its own, save power and a sketch of course.

This instructable will inform you how to run any atmegaxx8 series chip on its own.

Atmegaxx8 (doesnt matter which one but i prefer the 328)
Breadboard (circuit on bottom left is irrelevant)
USB Cable
USB-FTDI/USB-TTL (optional)
LED and resistor (optional)

Step 1: Breadboard

The breadboard setup is fairly simple and requires minimal components, none at all.
I have included a resistor on pin 14 or digital pin 8, purely to test my chip.

Step 2: Computer Setup

The computer side of things consists of a few easy steps but many people seem to get the wrong folders, make sure you are sure.

Download the bootloader files from here.

Go to wherever your arduino sketchbook is and create a new subfolder titled 'hardware'.

Extract the downloaded file Breadboard.zip into the new hardware folder you created.

Restart/start you arduino programming environment and you should see in tools-boards a new entry called arduino on breadboard

Step 3: Computer-Arduino Setup

Make sure to plug in your Arduino with the breadboard setup and have the ide running when doing these steps.

Under boards select the new arduino on breadboard entry.
Under programmers set it to arduino as isp
Under examples you will find an example called 'arduino isp' upload to your board.
Under tools click burn bootloader, this can take a few minutes so dont think its not working.

When this is all complete, you should have a chip that can function like a normal arduino but without the clock.

Step 4: Uploading Sketches

There are two ways of doing this, either with an Arduino or a USB breakout board type thing.

The Arduino way is detailed in the image.

The USB way is to connect TX to RX and RX to TX between the chip and your breakout board and just upload from there.

This is where you may want and LED, just to test its working.

I also like to print out a sticker for the chip so i know which pins are which, if the one below doesn't work inbox me and ill fix it.

<p>Hello, I was wondering if this would work for an atmega168-PU. I tried, but when I got to the burn bootloader step, it gave me an error. The error was:</p><p>avrdude: Expected signature for ATMEGA328P is 1E 95 0F</p><p>Is there something in the file I need to change?</p>
Well I've never worked with the 168-PU but my guess is you need to edit the bootloader file to match the specs of the 168, seeing as it is slightly different to the 328. I'm sorry i cannot help much more than that I'm afraid.
<p>The 168 and 328 use the same bootloader:</p><p>ATmegaBOOT_168_atmega328_pro_8MHz.hex</p><p>I believe vanofham's problem was in the coding:</p><p>avrdude -m328p</p><p>should be something like (for the 168):</p><p>avrdude -m168</p><p>;)</p>
<p>Just a heads up... I discovered a missing line in the linked board file (boards.txt inside Breadboard.zip). I added this line to the file and now I'm happily uploading to my 328p chips with IDE 1.6.8:</p><p>atmega328bb.upload.maximum_data_size=2048</p><p>Hopefully others may read this and avoid the hours of headache I went through troubleshooting serial upload errors. Regardless, thanks to the OP for sharing... this instructible taught me how to do custom boards with the new IDE (I was using 1.0.5 for custom boards until your I read this LOL... so much easier now THANKS!).</p>
Can I use any sketch unloaded atmega328 through breadboard without arduino? How can I do that ? How can I power the microcontroller? Which pin?
is this work with atmgea8????<br>please reply
<p>Hi,</p><p>i'm using an ATmega328 with its internal 8MHz clock for my project.</p><p>While bootloading there was a signature mismatch error.I just changed the sinature in the avrdude.conf file and overcame that error.</p><p>Now the chip is working perfectly ,and i can program it using a FTDI breakout.</p><p>but the problem is i cant receive or transmit nothing using the serial monitor.</p><p>can this be the problem in baud rate mismatch?</p><p>please help,i cant do myproject without serial monitor</p>
<p>Actually there is a much simpler way to program a stand alone AVR using an Arduino board. Read this tutorial:</p><p><strong>&quot;Arduino Uno R3 as a true ISP programmer for any Attiny and Atmega AVR&quot;</strong></p><p>see:</p><ul> <br><li><a href="http://forum.arduino.cc/index.php?topic=317138.0" rel="nofollow">http://forum.arduino.cc/index.php?topic=317138.0</a><li><a href="https://app.box.com/s/ol1z8jjnrpy6wly4w61imt7wcbxk3fcg" rel="nofollow">https://app.box.com/s/ol1z8jjnrpy6wly4w61imt7wcbxk3fcg</a></ul><p>No hardware removal is needed. No boot-loader has to be first loaded in your target AVR. You can simply program the Attiny or Atmega micro-controllers, existent on the breadboard, directly with the hex file generated from the source code you wrote (Blink a led, for example).</p>
<p>indeed, this is simple and less hassle, tried on 16MHz standalone, going to try on 8MHz now</p>
<p>indeed, this is simple and less hassle, tried on 16MHz standalone, going to try on 8MHz now</p>
<p>indeed, this is simple and less hassle, tried on 16MHz standalone, going to try on 8MHz now</p>
the idea here is to have an atmega that can be programmed easily from the arduino ide, using no external parts.
<p>The tutorial &quot;Arduino Uno R3 as a true ISP programmer for any Attiny and Atmega AVR&quot; is also valid for programming a stand alone AVR that uses its internal oscillator and has no external crystal and capacitors attached.</p>
<p>hi, i have the 1.6.1 version. i get an error message:</p><p>Error while burning bootloader: missing 'bootloader.tool' configuration parameter</p><p>any ideas?</p>
<p>check last part</p><p>https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard</p>
I have the version 1.5.1. I also get the same error
The only solution I found was to revert to the older version. I know the arduino companies are having issues and software versions are doing funny things. I got exactly the same issue myself.
<p>Until they have fixed it to work with the standard way of adding custom hardware to the arduino IDE here's what you can do:<br>1. Locate your arduino installation folder<br>2. Inside the hardware directory, find the boards.txt file. Mine (on Ubuntu) is at (/arduino-1.6.1/hardware/arduino/avr/) <br>3. Append the following at the end of the boards.txt file and it will work as instructed here. :)<br><br>##############################################################</p><p>atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)<br><br>atmega328bb.upload.protocol=arduino<br>atmega328bb.upload.maximum_size=30720<br>atmega328bb.upload.maximum_data_size=2048<br>atmega328bb.upload.speed=57600<br><br>atmega328bb.bootloader.tool=arduino:avrdude<br>#atmega328bb.bootloader.tool=avrdude<br><br>atmega328bb.upload.tool=avrdude<br><br>atmega328bb.bootloader.low_fuses=0xE2<br>#atmega328bb.bootloader.low_fuses=0xFF<br>atmega328bb.bootloader.high_fuses=0xDA<br>atmega328bb.bootloader.extended_fuses=0x05<br><br>atmega328bb.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex<br>atmega328bb.bootloader.unlock_bits=0x3F<br>atmega328bb.bootloader.lock_bits=0x0F<br><br>atmega328bb.build.mcu=atmega328p<br>atmega328bb.build.f_cpu=8000000L<br>#atmega328bb.build.core=arduino:arduino<br>atmega328bb.build.core=arduino<br>#atmega328bb.build.variant=arduino:standard<br>atmega328bb.build.variant=standard<br>###Experimental name:<br>atmega328bb.build.board=AVR_BARE</p>
sorry for the wait, yes I've had exactly the same issue recently. I believe its due to the way the arduino ide handles extra boards. it will work if you download an older version and I believe there are some updated board files for 1.6.1. google it. hope I've helped in some way
<p>This process does not work on 1.6.5, boards.txt in the sketchbook/hardware folder seems to be ignored.</p>
<p>check last part</p><p>https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard</p>
<p>Sorry for the late reply, but I ran into the same issue and I figured out the solution. So for the benefit of anyone who happens to see this...</p><p>Find the *actual* boards.txt that the IDE is using. For me it was in:</p><p>C:\Program Files (x86)\Arduino\hardware\arduino\avr</p><p>Edit the file (you may need to launch Notepad with admin privs), and copy-paste the contents of the boards.txt file attached to this instructable to the bottom of the boards.txt on your computer. Done!</p>
<p>Do you need to download the bootloader files if your Atmega already has the bootloader? </p>
I believe so, this is essentially a new bootloader that you will then flash to the chip.
<p>Ok, thanks</p>
<p>I got the code to upload to the ATMega328, error-free, but nothing happens. I have the blink example sketch uploaded, and an LED connected to pin 13 with a resistor, and 5v being supplied, but it won't blink. I have ground connected to pin 15 and 5v connected to pin 16.</p>
<p>May need a 10k or so pull up resistor on Reset ( pin 1 ) to Vcc</p>
<p>i programmed the bootloader just fine.</p><p>but im wondering if this chip will work on the arduino after the process or is it &quot;hardwired&quot; on internal clock afterwards?</p><p>i<br> prefer the second choice cause im making something very low badget and <br>dont want much external components since its not high tech.</p><p>my problem is that i cant upload a sketch on it.</p><p>btw you should use the hardware folder in program files</p>
<p>i programmed the bootloader just fine.</p><p>but im wondering if this chip will work on the arduino after the process or is it &quot;hardwired&quot; on internal clock afterwards?</p><p>i<br> prefer the second choice cause im making something very low badget and <br>dont want much external components since its not high tech.</p><p>my problem is that i cant upload a sketch on it.</p><p>btw you should use the hardware folder in program files</p>
<p>I've heard that using the internal clock introduced some inaccuracy that could compromise certain timing critical operations. Would this &quot;naked ATmega&quot; be safe to use as an I2C slave?</p>
<p>The internal oscillator does lead to inaccuracies but I2C is one of those protocols that does not require a synchronized clock with the device it's interfacing with, so no I2C will not be adversely effected by the internal oscillator. The protocol that does require a higher level of accuracy is UART or 'Serial'. Without getting into too much details the faster your baudrate of your UART the more likely there is to be errors. So if you are going to use a UART with the internal oscillator just try out a baudrate like 115200 and see if there is garbage outputting to the Serial Monitor if so reduce the baudrate to 57600. I've personally seen garbage come out on 115200 but that was not consistent. It's probably because the oscillator is temperature dependant.</p>
Thanks for the info. I didn't know about i2c being tolerant of timing fluctuation. That makes me feel better about choosing it for my project.
thanks Dave my knowledge of the subject was not sufficient to help but I'm glad you did. we learn from each other
personally I've never dug into i2c but there is no harm in trying. you are tight to say that the internal clock is not as accurate as an external one.
&quot;There's no harm in trying.&quot; Ha ha. That's usually true, but what I'm making is an altimeter for skydiving. There is actually a lot of harm in being wrong. By the way, I have successfully done this with [basically] the Leonardo chip as the host.<br><br>Programming AVR via Arduino Leonardo/Pro Micro: http://youtu.be/c4k59CFpYCA
<p>I'd be worried too, more so about static electricity produced during free-fall, frying your circuit unexpectedly. It's an issue that many manufacturers have had to deal with. </p>
<p>When doing this i had a terrible time getting it to work. I kept getting the signature error. Upon further investigation i found that just putting a crystal between the pins 9 and 10 and rerunning the bootloader would fix my problem. other than that this was very helpful.</p>
I'm glad you got it working but the whole idea of this was to build it as barebones as possible, when you want to run one quickly cheaply and embedded with very minimal components. But as long as it works for you then that's great.
<p>let me explain further. the crystal was only needed when loading the bootloader. its not needed anymore making it exactly what you have described.</p>
<p>If you don't have any crystal, this is a workaround you can use:</p><p>1- Before to start the burn the bootloader, connect a jumper wire between the physical pin 9 (XTAL1) of your ATMEGA in the Arduino UNO board and the same pin 9 on the ATMEGA in the breadboard. This will feed temporarily to your standalone chip with a clock signal.<br><br>2- Burn the bootloader from the Arduino IDE menu.<br><br>3- Disconect the temporary jumper wire, and thats it. Now you can upload the sketches as usual with your Arduino UNO as an ISP.</p>
<p>My arduino and other components are working, i connected the wire as you mentioned, but still getting errors like this:</p><p>avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x9e</p><p>could you suggest me any possible solution?<br></p>
<p>I don't see the connection I mentioned in the picture you attached. The connetion have to be made between the &quot;physical&quot; pins</p>
I apologise I misinterpreted your original comment. That's rather weird that you only needed it for programming, were you programming a blank chip or a previously boot loaded chip?
<p>Thats a good question. I do not remember if i got my chips with a boot loader on them or not. </p>
<p>avrdude: Send: 0 [30] [20]</p><p>avrdude: ser_recv(): programmer is not responding</p><p>avrdude: stk500_recv(): programmer is not responding<br><br>using an UNO, with correct board selected and programmer as ISP... any ideas? <br>IDE 1.05</p>
I think I know the cause, the board should be set as the atmega standalone one that you added earlier. The ide doesn't care what board you use as an isp only what boot loader it needs to burn, which is determine by the board setting.
<p>The board chosen when getting the above message was: ATmega328 on a breadboard. Should I be using a different option?</p>
sorry I must have misunderstood you initially. you are correct in having the breadboard atmega selected as your board. have you double checked your connections? it also doesn't hurt to re do the arduino as ISP bit.
<p>Checked connections, I did the following to error check (IDE 1.0.5): <br><br>1. Uploaded arduino as ISP to the chip on the arduino uno<br>2. Checked wiring on prototyping shield<br>3. Selected arduino as ISP in the programmer<br>4. Selected ATmega328 on a breadboard as board<br>5. Clicked burn bootloader under tools.<br><br>Still get the same result though...<br>I appreciate the help, any further ideas? </p>
<p>In the photo it seems you have no chip in the arduino - is it supposed to be removed? (Is the arduino as ISP no loaded on to the atmega on the physical arduino?)</p>

About This Instructable




Bio: I am a young electronics hobbyist, interested in computers, rapid prototyping and electronics.
More by AlistairM:True Atmega Standalone, Running without crystal oscillator (Arduino) Arm Mbed Microcontroller Basics Arduino Clap Sensitive Light Control (The Clapper) 
Add instructable to: