True Atmega Standalone, Running Without Crystal Oscillator (Arduino)

127,295

141

82

Introduction: True Atmega Standalone, Running Without Crystal Oscillator (Arduino)

About: I am a young electronics hobbyist, interested in computers, rapid prototyping and electronics.

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.

Requirements:
Arduino
Atmegaxx8 (doesnt matter which one but i prefer the 328)
Breadboard (circuit on bottom left is irrelevant)
Jumpers
Computer
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.

STEP 1.
Download the bootloader files from here.

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

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

STEP 4.
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.

STEP 1.
Under boards select the new arduino on breadboard entry.
STEP 2.
Under programmers set it to arduino as isp
STEP 3.
Under examples you will find an example called 'arduino isp' upload to your board.
STEP 4.
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.

123D Circuits Contest

Participated in the
123D Circuits Contest

1 Person Made This Project!

Recommendations

  • Make it Glow Contest

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

82 Discussions

0
expertpk1
expertpk1

Question 20 days ago

I could not understand so far that can a microcontroller (AVR ATTiny,ATmega,XMega) be used with sketch only and no bootloader?

0
AlistairM
AlistairM

Answer 19 days ago

Thats not what this tutorial is covering but yes you can run an AVR 8 bit micro without a bootloader by flashing a .hex file directly

0
expertpk1
expertpk1

Reply 18 days ago

Thanks AlistairM
I am new in Microcontroller Programming so this was the question in my mind,
but well I am a Software Engineer and so I have in mind that this will be possible.
Thanks once again.
Regards

0
kunalagarwal29997
kunalagarwal29997

Question 4 months ago on Step 1

in the circuit diagram you have not mensioned resistor and led

0
AlistairM
AlistairM

Answer 4 months ago

That's because it isnt relevant to flashing the bootloader onto the Atmega328p, as such, it is listed as optional and not included in the circuit diagram.

0
robotsaregood
robotsaregood

Question 2 years ago

will this work on 1.8.5?

0
LiboAhmed
LiboAhmed

3 years ago

Thanks
I can use xtl1 xtl2 output or input?

0
vanofham
vanofham

4 years ago

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:

avrdude: Expected signature for ATMEGA328P is 1E 95 0F

Is there something in the file I need to change?

0
AlistairM
AlistairM

Reply 4 years ago

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.

0
truglodite
truglodite

Reply 4 years ago

The 168 and 328 use the same bootloader:

ATmegaBOOT_168_atmega328_pro_8MHz.hex

I believe vanofham's problem was in the coding:

avrdude -m328p

should be something like (for the 168):

avrdude -m168

;)

0
truglodite
truglodite

4 years ago

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:

atmega328bb.upload.maximum_data_size=2048

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!).

0
vikas vijayan
vikas vijayan

4 years ago

Can I use any sketch unloaded atmega328 through breadboard without arduino? How can I do that ? How can I power the microcontroller? Which pin?

0
monusuthar2016
monusuthar2016

4 years ago

is this work with atmgea8????
please reply

0
JEWELJ5
JEWELJ5

4 years ago

Hi,

i'm using an ATmega328 with its internal 8MHz clock for my project.

While bootloading there was a signature mismatch error.I just changed the sinature in the avrdude.conf file and overcame that error.

Now the chip is working perfectly ,and i can program it using a FTDI breakout.

but the problem is i cant receive or transmit nothing using the serial monitor.

can this be the problem in baud rate mismatch?

please help,i cant do myproject without serial monitor

Actually there is a much simpler way to program a stand alone AVR using an Arduino board. Read this tutorial:

"Arduino Uno R3 as a true ISP programmer for any Attiny and Atmega AVR"

see:

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).

0
ArifSae
ArifSae

Reply 4 years ago

indeed, this is simple and less hassle, tried on 16MHz standalone, going to try on 8MHz now

0
ArifSae
ArifSae

Reply 4 years ago

indeed, this is simple and less hassle, tried on 16MHz standalone, going to try on 8MHz now

0
ArifSae
ArifSae

Reply 4 years ago

indeed, this is simple and less hassle, tried on 16MHz standalone, going to try on 8MHz now

0
AlistairM
AlistairM

Reply 5 years ago

the idea here is to have an atmega that can be programmed easily from the arduino ide, using no external parts.

0
victor.valadez.547
victor.valadez.547

Reply 5 years ago on Introduction

The tutorial "Arduino Uno R3 as a true ISP programmer for any Attiny and Atmega AVR" is also valid for programming a stand alone AVR that uses its internal oscillator and has no external crystal and capacitors attached.