Plug ATmega328 into breadboard after coding?

Is it possible to put the ATmega328 microcontroller in a breadboard with a 5 volt battery after coding it with arduino?

This seems kinda handy for me since I don't have the wires going from the arduino to my breadboard ;)

Yes that is the way a lot of people prototype stuff.

So I should just look at the datasheet and find the correct pins to connect stuff?

Btw, I don't know if it's possible. I think I heard about it. But is it possible to program the ATmega when it is in the breadboard?

So I should just look at the datasheet and find the correct pins to connect stuff?

Yep that's how to do it.

is it possible to program the ATmega when it is in the breadboard?

Yes simply supply it with the TTL level TX and RX signals. It is also better if you implement the auto reset as well although this is not essential if you press the reset button just after you ask the sketch to upload.

I am having trouble getting the chip out. It's resting there pretty firmly, any tips?

Gently, with a flat bladed electrician's screwdriver, working each end a little at a time.

Don't forget to ask the electrician if you can borrow his screwdriver first, though.

I screenshotted this from the ATmega328 datasheet.

If i'm correct, I should connect the +5 volts to pin 7 and the ground to pin 22 or 8(does this matter?)

TX and RX are pin 3 and 2 I suppose. How do I wire these pins up for updating my code?

You will also have to supply a 16mhz crystal & 2 caps (or a 3 pin resonator) and a reset pull-up resistor and a Vcc decoupling cap or two is also recommended.

Doesn't it have an internal oscillator?

Doesn't it have an internal oscillator?

Yes, but the Arduino system sets the AVR chip to use an external clock and you would have to learn how to burn new fuse settings and how to change all your coding to utilize 8mhz speed rather then 16mhz speed. It can be done but not the simplest way to go.

Lefty

It has an internal oscillator. The Arduino libraries assume a 16 MHz clock rate which you can't do with the internal. The internal oscillator also gives you about 1% precision (which is an error equivalent to about 14 minutes per day). You can do much better with a crystal, so it's strongly recommended. At that level of imprecision, you'll also probably have trouble with high speed serial communication.

Make sure you also connect AVCC and AGND.

There's a diagram on the playground somewhere similar to the one you copied but with all the arduino pins also labelled. I find it very useful when using the chip on its own with the arduino software.

There’s a diagram on the playground somewhere similar to the one you copied but with all the arduino pins also labelled.

Here’s one: http://arduino.cc/en/Hacking/PinMapping168

Now I just need the ATmega328 pin mapping. I don't have an oscillator here, but I'll order a few.

You just connect the oscillator to 2 pins and your done? How does the microcontroller actually recieve the signal of the crystal?

There is a tone of other stuff you need to connect BOTH grounds, and 5V to Vcc, Avcc and Aref. See the schematic for the stuff that surrounds this chip on my monome project:- http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html

Well.. You could save some tries following: http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard

You just connect the oscillator to 2 pins and your done? How does the microcontroller actually recieve the signal of the crystal?

You also need load capacitors from both sides of the crystal to ground. Or you can use a resonator instead of a crystal and caps.

Use 22pf caps for the oscillator and keep the oscillator and caps as close to the chip as possible.

The whole things sets up a positive feedback loop between the crystal and the internal circuitry that oscillates at 16Mhz after it starts up. Don't worry too much about how it works inside.

Make sure the breadboard sockets are clean and don't have deposits on them especially on the power and oscillator pins. I have had terrible problems because of bad connections, even though everything looked good. If possible buy a brand new breadboard if you are a beginner, because some of the cheaper ones get deposits building up on the internal tracks. Breadboards are also not the best things to work with at high frequencies, thats why its important to keep the caps and crystal as close as possible to the chip.

Once programmed you will be able to insert it into the board and wire it up and away you go. This is how engineers and hobbyists used to do things before Arduino/Wiring :)

For my breadboard Arduino projects I found it nicer to use a 'carrier board' that has all the support components that can then be plugged into the breadboard. It's easy to pop the AVR chip in and out of the carrier for programming in the Arduino development board.

http://spiffie.org/kits/duinostamp/

Lefty

Or you can go the whole way with a Duemilanove compatible in a 28-pin 600 mil breadboardable format that includes power regulation, USB, LEDs and a 16MHz ATmega328 - see the Oak Micros om328p.

Duemilanove compatible in a 28-pin 600 mil breadboardable

Nice! Any UK distributors?