Hello there! I am making a small clock project. It being a simple little project, plus the fact I have completed 4 very similar ones, I decided to skip prototyping and design and etch my PCB right away. It is all good, until I start the MCP1640 regulator.
I am using a version that connects input to output when disabled (Vin=Vout). My plan is to disable everything and go to sleep mode, then, once woken up, turn on the regulator to get voltage to power leds directly from my micro (attiny84). However, once I turn it on, the voltage boosts up to 7, or even 8 volts. Everything else is disconnected apart from Arduino, which I use only to supply power (Vcc, GND connected, no other wires).
The setting resistors are pretty close to the recommended setup. 910k and 330k against recommended 976 and 309. In the datasheet it says that the highest output voltage is 5 volts. I have quadruple checked all connections, if it's not the wrong way around, etc. Continuity tests ok, capacitors are there, the inductor seems fine, plus I have used the exact one before and it worked just fine.
I have tripped over my oscilloscope a while back and tore the probe in half-this and the fact I have other devices with max ratings way below the 8 volts prohibit me from probing around in the circuit.
fact I have other devices with max ratings way below the 8 volts prohibit me from probing around in the circuit.
I don't follow that, why?
I think you need to post your schematic.
The regulator outputs 8 volts into devices that have max. ratings of 6 volts. I don't really want to have that thing running while probing. That's what I meant. I don't wanna probe around while it's running. I will post the schematics now.
fact I have other devices with max ratings way below the 8 volts prohibit me from probing around in the circuit.
I don't follow that, why?
I think you need to post your schematic.
Here you go. This is the best schematic I could find. Edit: Whoops, this one is missing the enable pin. It's connected to my micro in fact, sorry about that, bummer. The values are arbitrary, I just made the schematic so that the layout process is easier. I have done minor changes since then, but that was only using different microcontroller pins for the sake of improved board layout and also connecting the programming header. However, it got a bit messy once I did that.
Hi, can you update your schematic to the values you are using, you have, Rbot and Rtop as 1K, but you say you used close to the specified values.
Also what is the value of the inductor the specs say between 2.2 and 10microHenries, your schematic shows 1milliHenry?
The other problem could be an earth loop on your PCB, or not big enough tracks to conduct the SMPS ripple.
What do you have EN connected to? You cannot leave it open.
Hope this helps
Tom......
PS Can you post a copy of your PCB pattern and layout.
TomGeorge:
Hi, can you update your schematic to the values you are using, you have, Rbot and Rtop as 1K, but you say you used close to the specified values.
Also what is the value of the inductor the specs say between 2.2 and 10microHenries, your schematic shows 1milliHenry?
The other problem could be an earth loop on your PCB, or not big enough tracks to conduct the SMPS ripple.
What do you have EN connected to? You cannot leave it open.
Hope this helps
Tom......
PS Can you post a copy of your PCB pattern and layout.
Hello! Thanks for your input. The inductor is 4.7uH and this type has worked before, no problems whatsoever.
Here is the etching thingy for the board. From left: inductor, capacitor, mcp1640, its resistors, via for enable jumper wire.
I have my enable connected to my micro.
Edit: Now that I think about it... I only have an electrolytic capacitor on the output, but... I have used this configuration before, no problems at all.
Have you tried a load resistor on the output to draw at least a minimum amount of current. Sometimes circuits like this need something being drawn from them to make the regulation work.
Grumpy_Mike:
Have you tried a load resistor on the output to draw at least a minimum amount of current. Sometimes circuits like this need something being drawn from them to make the regulation work.
You might be onto something. I have discarded this possibility before, not having found anything on this topic in the datasheet. The charts also don't say much and Google wasn't my friend either. I have added a 220 ohm resistor across the output pins and it goes from 4.9 volts when the led turns on up to 6.5 when it's off! Guess I will make the micro load the thing once it turns on. Thanks, man!
Yes-this was the best schematic I could find out of those I drew.
I have also used this chip many times before without any problems. That's what surprises me. The issues get smaller when I add the load resistor. So I guess that must be it. Odd. I am using Arduino 3.3v regulator as a power supply at the moment.
Edit: I can see your circuit is similar to mine, more or less. But you have more devices connected there, including some LEDS (are they turned on most of the time?). When I turn on the LEDs, problems disappear altogether.
Grumpy_Mike:
Have you tried a load resistor on the output to draw at least a minimum amount of current. Sometimes circuits like this need something being drawn from them to make the regulation work.
This wouldn't be one of them. Mine deliver the specified voltage with no load.
thegoodhen:
Edit: I can see your circuit is similar to mine, more or less. But you have more devices connected there, including some LEDS (are they turned on most of the time?). When I turn on the LEDs, problems disappear altogether.
Nope, off mostly.
Having to sort of reverse engineer your PCB pattern, assuming which parts are where, etc. See attachment below.
Are we looking at the top or the bottom of the board?
Do I have the correct position for the coil?
Is there a break in the trace where the input capacitor should be grounded?
Are the chip footprints correct? The ATtiny84 looks like we're looking at it from the top, but the MCP1640 looks like we're looking at it from the bottom (do I have their PIN 1 identified correctly?)
The SMDs are surface mounted, the attiny is through-hole; thus we are looking from the up on the smds and from bottom on the attiny. The gap there-I have just realised it's there a while ago. Must've been a bug in the software once I did the ground fill. However, it seems it isn't there in the final product for some reason. You are correct about the position of the inductor and VCC pin. Thanks for your time!
TomGeorge:
Hi, missing cap could help ,sometimes SMPS system become a black art.
Tom.....
I've tried adding a 100n ceramic in parallel-no changes. I have also added 2 dummy load resistors. Each one improved it a bit, now We are looking at 110 ohm dummy+220 ohm led-and the voltage levels aren't exactly dangerous-but they still are pretty high. 5.5 with the led on, 5.8 with the led off. But that's like what-50mA flowing through there? Can't help but think I am doing a workaround instead of actually fixing it.
Edit:
Do you think this could be a part of the issue? I wouldn't actually design it like that, not in my right mind, but ad-hoc, when I was soldering the stuff together, it seemed incredibly convenient...
Those caps are miles away. The secret of a good PCB design is to have the components as close as possible if not closer. Many professional engineers fail to get it right first, second and even third time.
Also try adjusting that resistor divider to trim the voltage closer to what you want.
Those caps are miles away. The secret of a good PCB design is to have the components as close as possible if not closer. Many professional engineers fail to get it right first, second and even third time.
Also try adjusting that resistor divider to trim the voltage closer to what you want.
Hm... I tried to put them as close as possible given the footprints...
About the voltage divider-yea, that seems to be the solution. I just... Don't really want to resort to a workaround just yet. That thing is supposed to output between 3 and 5 volts (even under no load at all according to J. Christensen who wrote in this topic and to what I can remember) , and I got it to output 8!
Something is terribly wrong and I'd rather know what it is before I fix it the easy way.
But meh, whatever. I will do the rest now and then get back to this. Thank you for your help!
As to the noise-well, it is bad, but the input and output caps are both electrolytic-and it is only like 2 times worse than specs say, I would say no wonders there.
Edit: Actually, I've just realised that if the components overlap, it doesn't matter since they are from a different side of the board. Didn't think that through.
thegoodhen:
Something is terribly wrong and I'd rather know what it is before I fix it the easy way.
Agree and agree, but I am scratching my head at this point. And in this case, I hardly consider "the easy way" a fix at all.
Layout is important, as Mike said. Attaching two PCB layouts that worked for me. The first is an initial experiment with the part, a combination of through-hole parts and SMT, the second is all SMT and corresponds to the schematic I linked above. You said you'd had the part work well in another project? How much difference is that layout from the current one?
As to the noise-well, it is bad, but the input and output caps are both electrolytic-and it is only like 2 times worse than specs say, I would say no wonders there.
You're probably aware, the datasheet also has some scope traces of the output, so those would be interesting to compare, but like you said, I'd go after the main problem first; I wouldn't be surprised if the noise improved once that is solved.
Hello. Thank you very much for your time. Yes, I am aware of that-the trace my scope shows looks pretty regular-saw tooth with typical capacitor charge/discharge curvature to it and a bit of noise-but that can as well be coupled in from the input.
The thing is-my layout isn't just an arbitrary one-it's based off of a recommended one with some modifications to allow single-sided board operation. The previous one which worked a treat was just some random sketch I did with my permanent marker, made a photocopy on it on printer, toner transfered and voilá. And it worked, despite being atrocious. And this is much lower load and it's not working. It's really really odd. I have no clue what is going on. I am even thinking about some wild stuff like ESD or solder heat, but I've had success soldering it with a transformer pistol soldering iron before-and this time I used a proper tool for the job, a temp controlled station... I am clueless.