The new Raspberry Pi B Model B+ is here - Pick one up in the store and check our detailed guide!

Strange reset problem

by at2marty on Wed Nov 14, 2012 6:25 pm

OK, this one has me a bit confused.

I am building a "stand alone programmer" for ATMEGA328 chips, mainly to upload sketches, not the boot loader. I wired up a "basic breadboard Arduino" more-or-less following the example schematic of a DC Boarduino. Where I deviate is rather than using an oscillator, I am using a crystal and a couple of .1uF caps on pins 9 and 10 (of the ATMEGA328). The only I/O pins that I am wiring up are pins 2 and 3 for the serial data (again, the pin reference is to the chip, not an Arduino).

The problem that I have run into is this. I can place an ATMEGA328 onto my Boarduino, upload a sketch and have no problems. If I try to do it on my breadboard, the sketch will not upload unless I manually pull the reset pin to ground when I select "upload" in the IDE. With my Boarduino, I never have to touch the reset button.

My problem seems to be the reset circuit. From pin 1 of the ATMEGA328 I wired through a 10k resistor to +5V which holds that pin high. Between that I wired though a .1uF capacitor to the RST pin (6) of an FTDI cable. My "manual method" is a jumper between the 10k resistor and the ATMEGA328 pin 1 to ground.

My question is, what am I missing that makes me have to manually reset while uploading a sketch on the breadboard when I don't have to do that on a Boarduino?
Posts: 45
Joined: Sun Mar 27, 2011 12:15 pm

Re: Strange reset problem

by adafruit_support_mike on Thu Nov 15, 2012 12:58 pm

Pulling random facts out of my hat, I'd guess you're running into issues with parasitic capacitance in the breadboard.

As a rule of thumb, the noise in a breadboard becomes noticable around 100kHz and gets ten times worse for every 100kHz beyond that. By the time you get into the megahertz range, you're trying to do jigsaw puzzles in a paint shaker.

That's especially true for digital signals, which have lots of abrupt changes. I recently breadboarded a test circuit using 100Hz square waves, and when I hooked it up to the 'scope the results were awful. The VCC and GND rails were bouncing around like Jello on a trampoline, to say nothing of the signals in the actual circuit. By the time I got the rails under control, about 40% of the components in the board were debounce caps.

So.. odds are good that your reset pin is seeing spikes from the clock or the programming signals.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
Posts: 8586
Joined: Thu Feb 11, 2010 1:51 pm

Re: Strange reset problem

by at2marty on Sat Nov 17, 2012 7:53 am

Thank you for the reply. That actually makes sense to me. I wish I had an O-scope handy to observe this.
Posts: 45
Joined: Sun Mar 27, 2011 12:15 pm