clock not working(or so i presume)

I'm working on transfering my project to a PCB, I have a couple atmega 328's with an arduino bootloader, I uploaded the program onto them using my arduino uno, and the program worked fine when i put the atmega in the uno, but when i took it out and stuck it on a breadboard using the same clock setup suggested by arduino's tutorial (http://arduino.cc/en/Tutorial/ArduinoToBreadboard) but the program is stuck, the LED should change color but it wont, and button switches are nonresponsive after the first time i use them which tells me that the clock must be malfunctioning somehow, any ideas?

My breadboard for reference

No bypass caps on your power connections, and no resistors for your LED, make for a particularly bad combination.

What value are the crystal loading capacitors? What happens if you just take them right out of the circuit?

the power supply im using is a switching 5v which i was led to believe eliminates the need for capacitors on the power lines, and as for the resistors to my LEDs the program running them is designed to keep the power input at safe levels to eliminate the need

and to jack, I am using 22pf capacitors and removing the capacitors causes it to not work at all

Not everyone has a scope, so clock issues are often sumized and difficult to prove.

Try this:
http://forum.arduino.cc/index.php?topic=153159.0

You now have a working board, so it is time to use an am radio and listen... Just adjust the am frequency setting until you can hear the "hash" of the uC/clock. Press reset, you should be able to "hear" the bootloader and even your startup code. As crude as this is, it can be a powerful diagnostic test.

Ray

Added:
Something like this can be found at yard sales for a few $.
http://www.ebay.com/itm/SONY-AM-FM-Transistor-Pocket-Radio-uses-2-AA-Batteries-/160706619166

austinphilp:
and to jack, I am using 22pf capacitors and removing the capacitors causes it to not work at all

Often breadboard setups will run without the loading caps, but I still suspect the clock. Is there a datasheet for the crystal or link whence it came? Has a different crystal been tried?

the power supply im using is a switching 5v which i was led to believe eliminates the need for capacitors on the power lines

No. Since you don't have a linear regulator, you don't need a regulator output capacitor to keep the regulator happy, but you still need "bypass caps" near the chip to help suppress short-term transients that happen when circuits inside the chip switch. Read one of the explanations for "bypass capacitors."

as for the resistors to my LEDs the program running them is designed to keep the power input at safe levels to eliminate the need

That doesn't work either. You can keep the power dissipation in the LED to reasonable levels by using short pulses, but the instantaneous current pulled from the chip during those pulses is still higher than the AVR is supposed to provide. These higher power output pulses PARTICULARLY cause transients on the pwr pins, which is why I said that the combination was particularly serious...

Link to the crystal: https://www.sparkfun.com/products/536
Do you think adding the capacitor and resistor will fix my issues?

austinphilp:
the power supply I'm using is a switching 5v which i was led to believe eliminates the need for capacitors on the power lines, and as for the resistors to my LEDs the program running them is designed to keep the power input at safe levels to eliminate the need

Well, you got that dead wrong on both counts!

You definitely need 0.1µF bypasses all over the place, but particularly adjacent to the chip itself - even better than on the power buses on the breadboard. This is because at the frequencies in question, even relatively short lengths of wire have significant inductance. It is also a good idea to have something like a 10 to 47µF reservoir capacitor on the board (or breadboard), to account for transients.

westfw:
Since you don't have a linear regulator, you don't need a regulator output capacitor to keep the regulator happy,

This refers only to the 0.1µF capacitor for high frequency stabilisation, on the regulator itself - linear regulators do not require any larger capacitor on the output.

As westfw points out, you cannot control the output current from the port by software - there is no means provided to do so.