Big capacitor near microcontroller - Circuit stops working

It charges pretty fast...

the atmega, the 100n caps and the shift registers are smd... the capacitor itself is pth

I'm starting to think that the behavior after I discharge the capacitor is just a coincidence, and it's charging is not actually the reason of the problem...

There appears to be a number of issues with your schematic/wiring. For starters I notice the following:

  • AREF should be pin 21
  • Avcc should be pin 20
  • Gnd should be 8 and 22
    ....

You better check them all and match the corrected schematic to your wiring.

The pinouts are correct for a 32-pin quad flat pack part.

CrossRoads is right... it smd part, so the pins are a bit different from the regular dip part...

Sorry - I didn't catch that.

Still it is difficult to explain this issue besides faulty wiring. Other than that I would check reset, power (including brown-out detection) and clock.

Stupid question, can you take the capacitor out of the circuit? Or change the program you're using to troubleshoot the problem?

If you're not sure if it's the capacitor or the software, changing one of them would be enough to determine that. Also, what's the voltage on the capacitor pins once it finishes charging?

Could the capacitor be defective?

I don't think the capacitor is defective, as I switched it and the problem wasn't solved...

bubulindo, I took the capacitor out of the circuit, and the problem never happened again. I'm just trying to understand what happend, so I don't make the same mistake again.

BenF, I also don't think that wiring problem. I soldered it, but it's a manucfatured board. Reset is right, and the brown-out detection is disabled. Also, I checked the 3v3 line after the system got stuck, and it's just fine... fixed at 3v3

So what is the capacitor voltage starting at and ending at?

It just goes to 3v3 when I power the circuit and stays there forever...

And when it gets to 3.3V the circuit stops working? Watch it with a scope - does it ramp up smoothly, or does it look to have some switching noise or something on it?

As i pondered before, it was more like a coincidence that the circuit stopped working and it worked again when I discharged the capacitor.

It stops working long time after the capacitor charges completelly... It has a ripple noise of around 100mV... There are also some 300mV spikes..

That sounds like a really crappy power supply, or there is some other signal connected in.
What are you using for a power source?
With that size cap, it should be a lot smoother.

I might be getting somewhere in the other forum (avr-freaks: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=104717&postdays=0&postorder=asc)... There was a suggestion that maybe my capacitor (which probably has relativelly high ESR) is introducing noise to the supply source with the raise of both the output capacitance and ESR for the supply source with the extra capacitor inserted.

CrossRoads, I'm using a L5973D based circuit using the 12V of a regular computer power supply. I'm getting a ripple of around 100mV...

brenin:
I have a circuit and when I put a big capacitor (330uF) near the atmega, the atmega gets stuck after running for a while. When I discharge the capacitor the circuit works again for a while and then stops again. On oscylloscope, i saw that the circuit stops working after the capacitor charges.

I don't understand this bit. Until the capacitor charges, the processor does not have full VCC voltage, right? So it shouldn't be working before it charges. And you are saying it doesn't work after it charges. So it doesn't work at all, basically?

What the capacitor might be doing is confusing the processor with a slow VCC ramp-up. At a certain threshold the processor detects that VCC is high enough and initiates reset processing. But the very act of doing this causes extra power consumption (eg. pull-up resistors) which drops VCC down below operating voltage. The processor might be confused.

What might help is a capacitor/resistor on the reset pin that delays reset processing slightly.

brenin:
As i pondered before, it was more like a coincidence that the circuit stopped working and it worked again when I discharged the capacitor.

It stops working long time after the capacitor charges completelly... It has a ripple noise of around 100mV... There are also some 300mV spikes..

[quote author=Nick Gammon link=topic=55711]
I don't understand this bit. Until the capacitor charges, the processor does not have full VCC voltage, right? So it shouldn't be working before it charges. And you are saying it doesn't work after it charges. So it doesn't work at all, basically?[/quote]

The circuit works after the capacitor is charged... It actually charges pretty fast, much faster then the time needed to get stuck...
What happens is that it stop working after running for some time (i.e hours on the first time it happens and up to minutes on the following occurrences)

Off the top of my head, I think you're just using way more power supply than you need.

You have a switch mode regulator that can switch 2.5 amps powering a 3.3 volt circuit drawing a few milliamps or so.

And, to make it's life hard, you have a 330 uf capacitor on there too.

Add some resistive load. Make that regulator do at least a little work. That should also reduce the ripple on the 3.3 volt output.

"It stops working long time after the capacitor charges completelly... It has a ripple noise of around 100mV... There are also some 300mV spikes.."

See what's happening? When the regulator sees the voltage start to drop, it turns it's switch on and drives current through the output inductor. It can't just switch to a smaller switch when there's virtually no load on the output. The result is excessive ripple on the output. It's like using a firehose to fill a drinking glass.

Even though... it SHOULD be able to handle it better. I gotta wonder how far away from the regulator the circuit is, and if you have a large capacitor (330 uf or so) at the regulator as well.

The worst possible set up is the regulator more than a few feet away, with no output cap, and then the 330 uf cap right at the CPU.

The datasheet for that regulator shows a 330uF cap on the output, however if you look at the BOM it's calling for a tantalum cap. Crossreferencing the cap in the BOM shows it is a very low ESR cap (in the 40mOhm range). If you have a tantalum cap at that value, try it instead and see if your problems go away. If you only have electrolytic caps try placing several smaller caps in parallel to get to the 330uF value. If the parallel approach works then it's possible the problem is with the ESR value.

Let's assume everything is connected as per the diagram (which is in some doubt).

If you can see the capacitor charging, then during that time the arduino is running on less that the supplies voltage output.
The fact that you can see it charging implies the power supply has quite a high input impedance.
When it does charge up the processor stops.

Possible causes:-

  1. If a voltage regulator is fitted there is not enough voltage drop across it to make it operate properly when there is 5V on the output side.
  2. The power supply is some value over 5V which is stopping the clock oscillator from working when the supply voltage finally reaches it.
  3. A low voltage drop out regulator is being used. They don't like too much load capacitance as it makes them unstable.

However best guess is that there is something else going on.