atmega168 won't work outside of arduino

I'm trying to move on to making my own circuits outside of the arduino, and as a result I've purchased a few 168s. I use the usbtinyISP to bootload them by attaching it to the arduino (duemilanove), then I add my code and run it, and it works fine. However, when I try to build a circuit on a breadboard, I can't get the chip to do anything.

I've attached a picture of the breadboard.
pin 1 is attached to 5v high through a 10k resistor.
pin 7 is attached to Vcc (I've tried 5v and 9v, both stable)
8 is ground
i've tried 9 and 10 connected by a 16 mhz crystal and without the crystal, no luck.
pin 14 (and a few others) should turn on the attached led, but they don't.
pin 20 is attached to Vcc/pin 7
pin 22 is attached to ground/pin8

thats it. the only thing that happens is sometimes the lower end (pin 14-15 end) gets hot. Please, tell me what I'm doing wrong here.

Thanks for your help, in advance.

http://www.uploadgeek.com/thumb-4982_49E8E1AC.jpg

I just realized how small the pic was resized to. Sorry if you cant see :frowning:

Yeah - that's really too small! I can only just work out it's a 28-pin chip!
Can we have a better picture :slight_smile:

In the mean-time:
your description of how the pins are wired sounds correct.
9v VCC is well beyond the maximum for the chip though! It could have fried things.

Don't you need a couple of 22pF capacitors with the crystal?
(That might just explain the "won't work", but not the "gets hot")

Have you got a couple of 0.1uF capacitors that you could pop between VCC/Gnds close to the chip?

I've tried 5v and 9v, both stable

Applying 9V directly to the ATmega168 chip may have damaged it. The Ardunio has a voltage regulator to reduce the input voltage to 5V.

You'll need two 22pf capacitors on the crystal pins, wired to Ground.

When I did mine I used this as a reference.
Its from the real bare bones board. A nice clear circuit diagram.
Also shows the power supply stuff to take 9v if you need it.
And the FTDI connections for programming insitu.
Although I couldn't get the auto reset to work so stuck with the reset switch.

Gordon

That circuit has a 16MHz resonator Which is different from the 16MHz crystal used on the arduino, though they do the same thing. You do need the caps between the xtal and ground to make it work.

Alternatively you can use the builtin RC oscillator (goes up to 8Mhz), though it may cause some weird timing stuff to happen if you're using delay() or millis() alot.

The mega168 will work fine off 3.3-5v (most version may even go down to 1.8v), so try using 2-3 AA batteries to power it.