Go Down

Topic: Breadboarding atmega328 yields unexpected behavior (newb needs help) (Read 1 time) previous topic - next topic

justanotherhumanoid

Jan 21, 2013, 05:09 am Last Edit: Jan 21, 2013, 05:13 am by justanotherhumanoid Reason: 1
Hello all, new user here, looking for some help and possibly an explanation of what I'm doing wrong.

What I'm trying to do is simply remove a atmega328 from an arduino uno r3 and put it on a breadboard, without any need to program it after that.

I decided to start simple and put "blink" on it before pulling it off and putting it on the breadboard. So, this chip was working just fine, running blink on pin 13 on the uno. Good start.

I followed directions found in these forums, got a 16Mhz crystal, 2x 22pF caps, connected power via a 5v switching regulator, and tied the reset pin high with a button to bring it low for reset. A photo of how I set it all up is attached.

Somehow, though, after pulling the chip off and placing it in what seems to me like identical circumstances, the LED on pin 13 just stays on/high and never blinks. I've checked my wiring (though I suppose it could still be incorrect), looked around the forums, and haven't seen anything quite like this behavior.

Open to any ideas/advice on troubleshooting this. Thanks in advance for the help.

Troubleshooting steps I've taken already:
1. Tried a different chip (bought another with optiboot, put blink on it, and replaced). No joy.
2. Tried removing my switch and just connecting 5V to RESET via 10kOhm resistor, bringing it low for reset by touching it to ground for a sec.
3. Checked connections and power with multimeter.

I don't have the decoupling capacitors I've seen mentioned a few places because I figured maybe I don't need them because of the 5v 1000ma store-bought supply I'm using - is that true?

Thanks again in advance. Looking forward to your thoughts.

Jack Christensen

Might try the attachment again, glad I've never forgotten an attachment ;)

Really should use 100nF caps on the power pins of all digital ICs, although I doubt in this case that their absence is the cause of the trouble.

I wasn't sure about the first description of the reset switch, the description under troubleshooting steps is the correct way to connect one, 10K resistor from the Reset pin to Vcc (+5) and the switch from the Reset pin to ground.

Edit: Got the pic now!
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

CrossRoads

#2
Jan 21, 2013, 05:24 am Last Edit: Jan 21, 2013, 05:29 am by CrossRoads Reason: 1
Put a resistor in series with the LED as well before you damage the pin.
You look to have excessive wiring on the reset switch as well. Go with just the resistor to +5 for now.
Try it without the 22pF caps as well. Folks sometimes get the wrong value by mistake (wrong part delivered) and that keeps the crystal from oscillating.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Jack Christensen

The reset switch is wrong. As long as you don't push it, things should be ok, but when you push it it will directly short the +5V supply to ground. The way the 10K resistor is plugged in, both leads to the same row of pins on the breadboard, means it has no effect. The reset pin is connected directly to 5V, which won't hurt the chip but is an incorrect reset circuit. Put the resistor from the reset pin to +5, and the switch from the reset pin to ground. The resistor is more than sufficient to keep the pin at 5V, but when the switch is pressed, the reset pin is grounded, and only about half a milliamp flows through the resistor and the switch.

Those little tact button switches aren't rated for all that much current, if you have an ohmmeter, I'd check it out, shorting out a 1A supply with it may have had a detrimental effect on the switch.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Jack Christensen

Ahhhh you have the crystal pins grounded!  Do you understand how the holes in the breadboard are connected to each other?
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Go Up