Bypass Caps

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
abqlewis
 
Posts: 71
Joined: Fri Dec 11, 2009 2:19 am

Bypass Caps

Post by abqlewis »

Just some rambling and a few questions:

So as a baby step into the world of microcontrollers, I wired up a simple circuit I found on the web. It was a simple ATtiny13 with 2 LEDs and current resistors. I finally got it to work, so I decided to play around with flickering the LEDs with PWM. It worked, but I noticed that after some period, the whole thing would just lockup. After flickering nicely like a candle for some arbitrary time, the LEDs would stay full on, or turn completely off, or just start blinking. I completely rewrote the code multiple times, but eventually it would lockup. I investigated other circuits, and almost all had bypass caps. My original, copied circuit didn't have any caps, so I just added a spare, big old 100uF electrolytic. Things seem to be better, but I don't know if this is a true fix for my problem.

1) Does this sound like a problem that can be just fixed with a cap?
2) How do I pick the right cap? Current, PWM Frequency, etc? Is it possible to have too high of value?

One of the times that I reprogrammed the tiny (before bypass cap), it stopped talking to the programmer. I don't remember the actual error, but I've seen it talked about with bad fuses. I was using the same makefile, so I don't think my fuses were suddenly wrong. I traded out the tiny13 and it worked. MY THEORY - If the lack of a bypass cap can make the uC go wonky, it can also go wonky while programming, and who knows how things are programmed now. I notice a lot of the DIY programming break-out boards don't have bypass caps.

3) Should I have bypass caps on a programming board?

Thanks

User avatar
opossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am

Re: Bypass Caps

Post by opossum »

1 - Yes, if there are no other problems.
2 - 100 nF (0.1 uF) ceramic. Electrolytic have too high ESL to be effective
3 - Yes

User avatar
stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Bypass Caps

Post by stinkbutt »

Can you be more specific about your use of the term "bypass cap?" Are you talking about a capacitor leading from Vcc (pin 8 on the ATTiny13) to ground to filter out any noise in the power supply?

I was a little bit surprised an electrolytic isn't working for you. Sure, electrolytics are for shite, but I thought that was the one place they're useful, filtering out power supply noise. Though I suppose if it's old enough both the ESR & the leakage tend to go in the wrong direction, as Possum pointed out.

User avatar
westfw
 
Posts: 2008
Joined: Fri Apr 27, 2007 1:01 pm

Re: Bypass Caps

Post by westfw »

The problem with a large electrolytic is that internally they're basically a coil of foil, with significant inductance. That makes them "not good" at filtering out the very high frequency noise introduced on the power rails by the microcontroller itself (1+MHz), though they do an OK job at filtering out things like the 60Hz hum from the AC lines audio-frequency noise from elsewhere.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”