MC34063 gives me ADC noise on AVR! :( - Page 1
Forum section: electronics / projects

author: shadewind
author_rank: Frequent Contributor
timestamp: March 01, 2011, 02:18:24 pm
content: Okay, here we go again with my MC34063 problems. Now I think I've managed to calculate everything correctly but when using this circuit to power an AVR circuit with an ATMega8 controlling some LEDs using the ADC inputs, I get lots of ADC noise which makes the LEDs flicker. Everything worked perfectly when I was using a linear regulator.http://www.onsemi.com/pub_link/Collateral/MC34063A-D.PDFThe one I have used is the one on page 7, bottom right (which isn't complete, I know but I've completed it with the one above).The values and components are as follows:Rsc = 0.22 ?Input capacitor = 100 µFFeedback resistors = 30 k? and 10 k?Diode = SR304External switching transistor = STX826Timing cap = 680 pFInductor = 22 µHOutput cap = 100 µFI'm feeding it 12V through a wall wart but I've calculated it to work with voltages down to 7 volts as well.I've tried adding an extra LC-filter (another 22 µH and another 100 µF) but that didn't help. I've decoupled VCC and AVCC, each to ground with a 0.1 µF X7R cap. AREF is also decoupled in the same way. I've tried filtering AVCC through a series inductor as well but that does help. I've tried enabling the brown-out-detector to see if it resets because of crappy power but it runs fine. The only thing I have yet to try is look at the power through an oscilloscope since I don't have oneIs it my power circuit which is miscalculated or otherwise crappy? Is this a common problem? It all worked fine when using a linear regulator but I need more power with less heat.

author: tecman
author_rank: Frequent Contributor
timestamp: March 01, 2011, 02:43:59 pm
content: The issue of noise can be many faceted. There is noise straight through the supply, common mode noise, and magnetically coupled noise. You stated that you added an L-C filter with no effect. So you now should look at common mode noise. This can be coupled through the ground leg to the uProcessor. Make sure that the leads are short and heavy enough for the peak currents. Remember that the mail output cap on the 34063 sees large current spikes. The wiring from the diode to the cap is also critical. These runs should only contain power suppl currents as much as possible. The output from the power supply should be pulled directly from the output cap, in terms of wiring. The last item is the inductor. What type of inductor is it ? Is it too close to other sensitive wiring ? Toroids are best for minimal leakage inductance. Little straight wound chokes (look like resistors with windings on the outside) are the worst.One solution is to derive your AD ref from a small linear reg and use the 34063 for everything else.I have a number of products using 34063s and see AD input noise under 10 mV. Layout and design is critical.paul

author: jahonen
author_rank: Super Contributor
timestamp: March 01, 2011, 03:11:48 pm
content: It shouldn't be a surprise to anyone if 34063 produces noisy output voltage. 34063 is used because it is cheap, absolutely not not state-of-the art switch-mode regulator in noise sense. Biggest problem is subharmonic switching noise (which is for example in audio band) due to its naturally erratic (some call it hysteretic) operating principle.You can see my measurements of the output (in step-down configuration) inhere.Regards,Janne

author: shadewind
author_rank: Frequent Contributor
timestamp: March 01, 2011, 03:37:55 pm
content: tecman: Well, I'm running everything as short as I can on the breadboard which is not easy. The inductor is a ferrite core radial one.jahonen: Are saying this is to be expected when using the 34063? Because if I'll have to work really hard to make this work, it's probably better just getting another switcher. It's not like I'll have a fancy PCB with ground planes and stuff, it'll be a quick and dirty protoboard so if it doesn't work on a breadboard, it probably won't work there either. Any recommendations for nice but relatively cheap regulators?As you've said, I could simply use a 7805 to power the MCU and analog stuff and then use the 34063 to power my LEDs (which is what'll require all ze power).

author: jahonen
author_rank: Super Contributor
timestamp: March 01, 2011, 04:57:22 pm
content: Good that you mentioned the Breadboard, as it probably is the major contributors of noise in this case. Breadboard is a difficult environment for a switch-mode regulator, since loops and parasitic capacitances tend to be large, whatever the placement. Also, radial inductors tend to have relatively high stray field. I'd change that to something more shielded, but that is again difficult on a breadboard. However, I have many times soldered wires to a SMD-inductor and used it on a non-SMD-way in some occasionsWhat is your regulator configuration, step-down or step-up? What is the input voltage/output voltage and current? For step-downs, my usual choice for casual use has been LM2675, it is very simple to use and it usually works satisfactorily even with non-perfect layouts. For step-ups, LM2588 (5 A switch current) or LM2585 (3 A switch current) might do the job.If the regulator fails to solve the problem, you might build the regulator on a separate copper clad board (using Jim Williams high-speed style), using it as a ground plane, and just connect this "sub-board" to breadboard using wires. This will eliminate ground-induced noise.Regards,Janne

author: shadewind
author_rank: Frequent Contributor
timestamp: March 01, 2011, 05:05:21 pm
content: I was going to order the LM2575... any reason why the LM2675 is better?

author: jahonen
author_rank: Super Contributor
timestamp: March 01, 2011, 05:21:56 pm
content: Quote from: shadewind on March 01, 2011, 05:05:21 pmBetter is a bit strong word here, LM2675 has higher switching frequency, so smaller inductors can be used (I usually stick 68 µH or similar). LM2575 is probably also ok and has high voltage version also available, if needed.Regards,Janne

author: shadewind
author_rank: Frequent Contributor
timestamp: March 01, 2011, 05:49:57 pm
content: I went with the LM2675 with a 47µH inductor as per Nationals recommendations. We'll see how that goes. I don't expect it to suddenly work given the less than stellar circumstances (breadboard) but from what I understand, MC34063 is really the worst you can getAnwyay... how will lowering the input voltage affect the output voltage with no other parameters changed?

author: jahonen
author_rank: Super Contributor
timestamp: March 01, 2011, 06:16:52 pm
content: Quote from: shadewind on March 01, 2011, 05:49:57 pmLowering the input voltage is not usually a problem (unless it stays above the minimum specified for a regulator chip), it just reduces inductor ripple current and thus output voltage ripple. Thus there is no problem with using lower than nominal input voltage, inductor is just not optimal in cost-sense (unnecessarily large) but in performance sense, no problem or even better.Regards,Janne

author: tecman
author_rank: Frequent Contributor
timestamp: March 01, 2011, 08:36:42 pm
content: I would not call a 34063 "the worst possible". Since it requires a number of discrete components, physical design and layout are more critical. Most of the high current components are external, so their placement is where to pay attention. Since it is a current mode switcher, overall noise inducing factors are actually lower than some other chips.paul

author: tecman
author_rank: Frequent Contributor
timestamp: March 01, 2011, 08:39:13 pm
content: I would not call a 34063 "the worst you can get". Since it requires a number of discrete components, physical design and layout are more critical. Most of the high current components are external, so their placement is where to pay attention. Since it is a current mode switcher, overall noise inducing factors are actually lower than some other chips.I agree with jahonen that breadboarding any switcher can be a big problem due to poor grounding and current carrying paths being far from optimal.paul

author: jahonen
author_rank: Super Contributor
timestamp: March 01, 2011, 08:52:56 pm
content: When I first measured 34063 I thought it is broken (switch node waveform seems erratic), but I found out that the effect what I observed is actually described by OnSemi:AN920-Dsays:QuoteThis process invariably produces subharmonic noise since there is no stable operating point (see my measurements, it produces peculiar multi-level ripple). Of course, the good thing about simple operation that it can't be unstable, regardless of the filter capacitor ESR etc. since there is no regulating loop in same sense than in conventional regulators. I wonder if bad reputation of SMPS in audio applications is due to 34063 or something like that. But at least it is very cheap, certainly adequate for many applications.Regards,Janne

author: scrat
author_rank: Frequent Contributor
timestamp: March 02, 2011, 12:31:01 am
content: Quote from: jahonen on March 01, 2011, 08:52:56 pmIf I understand correctly, this seems to lead to the use of a low value capacitor on the output (possibly followed by another LC filter). If the cap is small enough, the limit-cycle should happen into one switching (clock) cycle, thus avoiding most of the sub-harmonics you mention.

author: shadewind
author_rank: Frequent Contributor
timestamp: March 02, 2011, 03:39:19 pm
content: UPS arrived with my components from Farnell today (it's crazy how fast Farnell is) and I tried out the LM2675N-5.0, that is the fixed 5V version. I wired it up in just a couple of minutes and it worked perfectly on the first try with no noticable noise on the ADC inputs. Think I'll stick with this one

author: jahonen
author_rank: Super Contributor
timestamp: March 02, 2011, 04:08:41 pm
content: Nice to hear that it worked. LM2675 is really "simple switcher", hard to go wrong with it.Regards,Janne

author: shadewind
author_rank: Frequent Contributor
timestamp: March 04, 2011, 03:25:21 pm
content: A question here... how important is the choice of the input and output capacitor here? The data sheet gives advice on specific models which all have a very high price in common. There doesn't seem to be anything in common between the suggested capacitors... the capacitances are not even in the same ballpark with one of the suggested ones for a 22µH inductor having a capacitance of 220µF and another one having a capacitance of 2200µF!What should I choose?

author: jahonen
author_rank: Super Contributor
timestamp: March 04, 2011, 03:39:43 pm
content: Basically, input capacitor should be large enough to withstand the input RMS ripple current (which is half of output DC-current worst case if duty cycle is 50%), and output capacitor should be large enough so ESR-related ripple is small enough. Capacitance itself does not usually dominate very much, usually ESR-related constraints mentioned are more significant.Regards,Janne

author: shadewind
author_rank: Frequent Contributor
timestamp: March 04, 2011, 03:44:00 pm
content: How is the ripple related to the ESR of the output capacitor?*goes googling*

author: shadewind
author_rank: Frequent Contributor
timestamp: March 04, 2011, 04:03:10 pm
content: What's worse is that nearly all of the recommended models I checked have been discontinued!

author: jahonen
author_rank: Super Contributor
timestamp: March 04, 2011, 04:38:39 pm
content: Quote from: shadewind on March 04, 2011, 04:03:10 pmJust find some good low-ESR (or low-Z) from brand name manufacturer (like Sanyo, Panasonic, Nippon-Chemicon etc.), and you'll be just fine (at least if we are still talking about LM2675).Regards,Janne

author: shadewind
author_rank: Frequent Contributor
timestamp: March 04, 2011, 04:45:00 pm
content: I'm actually talking about the LM2676 now since I need a bit more power for another project. And the capacitance doesn't really matter, or what?

author: Unknown
author_rank: Unknown
timestamp: March 04, 2011, 10:51:51 pm
content: Just a little contribution, did not want to start a new thread. When designing a boost converter with the MC34063, you must make sure that the duty cycle is not more than 0.857 or 85.7%.This is a limitation due to the internal design of the IC and it is often overlooked. It is not stated on the datasheet (ON semi) but it is stated in the application note (ON semi again).I saw a published circuit that did not consider this so I though I would bring it to your attention. It is fine on Dave's blog #110 (75%) but the limitation was not mentioned.

author: shadewind
author_rank: Frequent Contributor
timestamp: March 05, 2011, 01:26:28 am
content: Quote from: Alex on March 04, 2011, 10:51:51 pmGood to know! I will probably not use the MC34063 for this project since the LM2676 requires much fewer parts and provides 3A without external transistors but who knows in the future

author: jahonen
author_rank: Super Contributor
timestamp: March 05, 2011, 07:24:34 am
content: Quote from: shadewind on March 04, 2011, 04:45:00 pmAt least for electrolytics, if the ESR is acceptable, then the capacitance is also. This is supported by the fact that if one calculates necessary capacitance for certain amount of ripple (ignoring ESR for a while), it is usually ridiculously small. Thus in practice one ends up with much greater capacitance due to ESR reasons. If you look at the sizes of recommended oscons versus electrolytics, you'll notice that recommended oscons have much smaller capacitance. Oscons tend to have very low ESR values compared to their capacitance. LM2676 seems not to be particularly sensitive to low-ESR output capacitors, since oscons are mentioned in the datasheet.Regards,Janne

author: scrat
author_rank: Frequent Contributor
timestamp: March 05, 2011, 12:32:12 pm
content: Quote from: Alex on March 04, 2011, 10:51:51 pmWhat's the problem with high duty-cycles? Is it related to the small time interval between two switching events? I don't see any other reason, even thinking of stability.

author: Unknown
author_rank: Unknown
timestamp: March 05, 2011, 01:11:16 pm
content: Well, the MC34063 is not a PWM controller to be honest. It has a fixed duty cycle and applies that to the transistor if the output voltage is too low.With reference to the datasheet, the issue is caused by the OSC block where the timing capacitor is connected. The OSC block charges and discharges the timing capacitor Ct with a constant current of 35 uA and 200 uA respectively. The voltage across the cap is an assymetric 'sawtooth' waveform (when the duty cycle is not 50%) like in figure 4 in the datasheet.The ratio of currents is about 1/5.7, so with constant capacitance and voltage thresholds, the ratio of ramp up and down time is 1/5.7. The total maximum duty cycle is therefore 5.7/(1+5.7) = 5.7/6.7 = 0.851 or 85.1% !You might be thinking that you can reduce the off time (ramp down) by selecting a smaller capacitor, but will also reduce the on time (ramp up). The app note AN920/D gives a way to increase the duty cycle but it uses germanium parts which, to be fair, eliminates the purpose of using an MC34063.

author: scrat
author_rank: Frequent Contributor
timestamp: March 07, 2011, 02:06:16 pm
content: I see, the upper limit is because the reset control dominates and is generated once a period at a given instant. I didn't look so good at the functional schematic. At this point, I wonder why they decided to do so, but this is another story.However, the 34063 is a -strange- PWM controller, since it modulates the duty-cycle depending on how much the output is lower than the reference. The strange thing (IMHO) is that they used a kind of negative logic: instead of turning on the switch synchronously and switching off when the output is high, it behaves viceversa.

author: Unknown
author_rank: Unknown
timestamp: March 07, 2011, 04:08:18 pm
content: You got it, the timing capacitor cannot instantly discharge forcing D<100%.Have a better look at the diagram below again, it is the MC34063 connected as a buck converter. Same principles appy.You will notice that what appears to be an op-amp that generates an error signal by comparing a reference and a fraction of the output, is in fact a comparator driving a logic gate.In other words theMC34063 does not generate an error signalproportionalto the output. It's a simple Yes/No signal. I think this topology is called 'simple switching' or 'switching' regulator but dont quote me on this. Maybe someone can confirm.The signal can become Yes asyncronously. Say it becomes Yes at the end of the timing capacitor voltage ramp down. During the next cycle it will initiate an On cycle. In the case of a boost converter the output voltage continues to drop when the inductor charges, therefore the comparator still outputs a Yes. As the output transistor can only be switched off during the ramp down, there is a scenario where much more energy is stored in the inductor than needed leading to overshoot at the output voltage if it wasnt for the current sense resistor. If excessive current is sensed, the charging current for the capacitor is increased shortening the remaining ramp up time.If there is any modulation on the pulse width, it is purely due to syncronisation of the output voltage drop with the sawtooth waveform. That, combined with the low switching frequency of 100kHz max, makes me think this regulator will give poor performance in pulsed applications if a monster output cap is not used.Now compare with proportional control from an LM2588:

author: scrat
author_rank: Frequent Contributor
timestamp: March 07, 2011, 05:41:25 pm
content: It behaves somewhat like a sampled-time linear controller, with duty-cycle limited to 85% very high gain (which depends on the output capacitance and output current).Imagine that it samples the error value at the rising edge of the oscillator (the length of the off period at the start is proportional to how much the output is over the reference, since the output capacitance discharges when the switch is off).Now I see why the duty-cycle limit is there: into a boost converter, if there was not a limit, it would have been highly unstable (as you described above) maintaining the switch on for all the time, when the output was low. Thanks to the duty limit, this doesn't happen, even without the current sensing (which is not needed, in fact, as I experimented).

author: jahonen
author_rank: Super Contributor
timestamp: March 07, 2011, 07:26:40 pm
content: Can't it be described shortly without philosophizing by just saying that internal oscillator runs with 85% duty cycle if sensed voltage is below the reference and oscillator is completely off when sensed voltage is above the reference? I think it can be seen from the attached scope screenshot (measured from the switch node).It also explains why the ripple is so peculiar, there are times where switching frequency drops very low (long time between bursts).Regards,Janne

author: scrat
author_rank: Frequent Contributor
timestamp: March 07, 2011, 09:55:50 pm
content: Quote from: jahonen on March 07, 2011, 07:26:40 pmWell, it can have duty-cycle between zero and the maximum, since it can switch on AFTER the sync from the oscillator.That was just my view of the thing, a model that (for me) gives best insight into the behaviour. I think that a lower cap value (and an additional filter, as in one example in the app note) could avoid that oscillation, at least for a range of load values.

author: Unknown
author_rank: Unknown
timestamp: March 07, 2011, 10:56:02 pm
content: Great info guys, thanks for your help exhausting this issue. I would have not brought this up if I had not seen a working (!) published design in a popular electronics mag. Hopefully this will help eliminate such designs.Alex