ATMega328 Standalone Help?

dj505

Inexperienced Romhacker
OP
Member
Joined
Oct 4, 2014
Messages
556
Trophies
0
Location
Most likely at the arcade
Website
www.youtube.com
XP
834
Country
Canada
Hi all!

So, I saw this video showcasing how you can shrink down Arduino projects by just running the code off a standalone ATTiny85 chip. The video describes how to set up the chip and use another Arduino to program it, which I have the parts to do. I was wondering if the same can be done with an ATMega328? I ordered a few off eBay since I needed more I/O pins and storage space for sketches.

My main question is how to run the Arduino code off an ATMega by itself. The reason I ask is that all the tutorials I've seen tell you to use a 16mHz crystal and two small capacitors and stuff to make an Arduino-compatible circuit right on a breadboard. That's not what I want to do. Someone told me I don't need those components, because the ATMega chip has fuses and an internal clock, and I don't need to burn a bootloader, but I just want to make sure. All I need is just the ATMega on the breadboard, capable of running Arduino code, even if it's only at half speed, like this:
aUqBCVZ.jpg
As you can see, no components other than the breadboard and ATMega.
EDIT: Or can I just program the ATMega in the Arduino, take it out, and place it on the breadboard? If so how do I power it?


On a side note, how would you power it? 5 volts connected to the +V pin and ground? Or could it handle 9 volts directly?
 
Last edited by dj505,

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
22,599
Trophies
4
Location
Space
XP
12,575
Country
Norway
I would recommend to add a 16mhz crystal osc and two ceramic capacitors (18/22pF) as I believe the code only runs at a reduced 8mhz otherwise, and timing will be less accurate. You can get them very cheaply. I have a breadboard Arduino I set up this way, I also added a reset switch to it. Works exactly like a real Arduino, minus the built-in USB.

You're planning on using the ArduinoISP sketch with your regular Arduino to program the breadboard Arduino? I could never get that one to work, and had to resort to using the bitbanging mode of the FTDI chip on my Arduino board to "emulate" an ISP programmer in software using a modded version of avrdude. Not recommended, it was a pain in the ass to get working. A cheap USBtinyISP programmer is a useful thing to have, I went and bought one for $8 on eBay so I would never have to go through that ordeal again. I would especially recommend one if you are programming several atmega328 chips, it makes life so much easier.

I would also recommend getting a USB-TTL adapter to upload sketches and talk to them through serial directly so that you don't have to piggyback on the Arduino board to do anything. It's a very useful tool to have. Mine broke shortly after getting it though. Note to my future self: don't cheap out on the USB-TTL adapter, get a proper FTDI one even if it costs way more.

Both of those will cost you maybe $7 in total with free shipping and they are one-time investments that can be reused for other projects so it makes sense to have them if you do a lot of Arduino stuff. FTDI USB-TTL adapters are way cheaper than last time I checked, I can find them on eBay for as low as $2 now when they used to cost $20. Probably cloned chips, but who cares as long as they work.

Actually, since then I bought a few breadboard-able Arduino clones off of eBay which have built in programmable USB and only cost me $8 a piece, I find that there's not much point in making a barebones Arduino yourself anymore when you can get everything on one tiny board that fits nicely onto a breadboard for only $8, and can be soldered directly onto if you want a more permanent project. Though there is something to be said for making your own Arduino, it's a pretty cool project.
 
Last edited by The Real Jdbye,
General chit-chat
Help Users
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
  • Iron_Masuku @ Iron_Masuku:
    Hello
    Skelletonike @ Skelletonike: hmm