EEVblog Electronics Community Forum
Electronics => Microcontrollers => Topic started by: Simon on September 06, 2013, 05:22:47 pm
-
I've made up a board with an ATmega328P-AU (TQFP package). It has one analog in and one PWM out (yes waste of a chip and yes arduino based).
Problem is that the MCU is getting VERY hot and drawing about 290 mA and the 5V has dropped to 3.3Vish because i have a series resistor on the regulator to help limit current like this. There are no shorts of any of the I/O's used and i've not been able to program it (via AVRISP from the arduino IDE), it comes out with:
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0xff
avrdude: verification error; content mismatch
Any idea's ?should I try the excruciating experience of removing the MCU ?
-
That you cannot ISP program it suggests that one of those lines is shorted to ground or Vcc. I'd inspect the soldering carefully.
-
Is it an AVR chip for sure (genuine)?
Alexander.
-
yep, bought from RS, turned up on a massive tray for 5 chips ;)
-
Some I/O pins must be sourcing or sinking a lot of current (the limit is 40mA per pin). By default the I/O pins should be in HighZ mode, so there's something very wrong.
-
quite, I have 200 ohms on the 5V line which is a bit odd but them with no power the chip will give different readings. 200 ohms is 25mA so not sure where the attempt to draw over 300mA comes from
-
As I saw the pin out for the TQFP is GND-VCC-GND-VCC. Could be a short circuit among those.
Alexander.
-
nope, that would not make the MCU overheat just the regulator. the resistance from GND to VCC is 210 ohms
-
No, it would not. So... Try another chip. :-/O :-/O :-/O
Could the chip got damaged during soldering?
Alexander.
-
Maybe an inappropriate question :-), but do you got the chip orientation right?
-
Maybe an inappropriate question :-), but do you got the chip orientation right?
A very valid one for a square package. Yes it is on there right
-
Pull-up resistor for the reset pin?
-
I have one.
i attach the schematic for everyones amusement
-
Could it be as obvious as just incorrect pinout (schematic symbol or PCB footprint error)? Worth to check actual board VCC and GND pins against datasheet.
Regards,
Janne
-
yes I have done that.
-
I have one.
i attach the schematic for everyones amusement
Seems to be fine. The only thing I saw is that AVcc isn't connected to Vcc. It should be connected even if the ADC isn't used.
-
ok, could it cause a problem like this ?
-
ok, could it cause a problem like this ?
Actually it shouldn't.
-
Did you take ESD precautions?
Try another chip.
-
I've seen ATMega's get hot when they have been damaged.
I once put 12V onto VCC when some wires rubbed together for a split sec. After that the current jumped up by a massive amount and it never worked again.
I highly suspect your mcu is dead.
-
Did you take ESD precautions?
Try another chip.
nope, good point
-
Well i took it off and found the (SOIC) regulator supplying 6.8V ! so i replaced the reg and still supplying 6.8V! replaced with a standard through hole 78L05 and now outputs 5.25V, Someone at Farnell is in for a bollocking !
-
Reversed pinout? Do they make helpful LM78L05R parts? ;)
-
well I followed the datasheet pinout. Not my problem.
-
right, put another atmega on there and still overheats and now my reg is at 7V again! this is the TO-92 version, how on earth can an ATmega cause a reg to up it's voltage ?
-
Is the regulator ok? If the micro is somehow sorted it could easily kill the regulator causing a voltage rise. Also an error in the regulator circuit could overheat a micro.
-
What is connected to the PWM pin?
Is the Vref pin connected to 5v? If it is, that might be the issue. You can short out the internal reference voltage.
What kind of a power supply are you using?
I had someone give me an arduino uno that was broken. The arduino unos have a major fault where the 3.3v regulator can short out, and the 5v regulator will give out around 6-7v!
(This is not from an excessively high 3.3v rail - the 3.3v rail was infact lower than 3.3v - and the arduino was fed the correct voltage when it died)
-
well showing 2-3K on the 5V output (reg+ MCU) the short happens when the atmega gets power, I can't control what goes on inside the damn thing ! particularly when it is not even programmed yet
-
What is connected to the PWM pin?
Is the Vref pin connected to 5v? If it is, that might be the issue. You can short out the internal reference voltage.
What kind of a power supply are you using?
I had someone give me an arduino uno that was broken. The arduino unos have a major fault where the 3.3v regulator can short out, and the 5v regulator will give out around 6-7v!
(This is not from an excessively high 3.3v rail - the 3.3v rail was infact lower than 3.3v - and the arduino was fed the correct voltage when it died)
Vref is unconnected, the PWM is connected to a 2N7002 mosfet gate. the supply is a plug in adapter that delivers a so called 12V but 22v in reality, then a 470R resistor in series with the blessed 5V regulator.
-
I'm on the verge of replacing the stupid atmega with a tiny in DIP if neccessary, just don't get this behavior
-
well I got my code to load
-
right, it starts at 5V and then after a few seconds suddenly starts climbing - I pulled it at 8V !, zener reg required ? after all current consumption is pretty predictable !
-
There's something wrong with your regulators. Try with a proper current limited supply.
What regulators are you using, exactly?
-
Well using a 78L05ACZ from ST, also used the soic version. this is getting ridicolous, the voltage was fine until the Atmega went back in.
-
Well either you've got faulty regulators, faulty micros, or you're killing the regulators with heat and/or excess input voltage. It's easy enough to work your way through those problems, starting with just running the circuit from a current limited supply which won't kill your micro.
-
sadly don't have one.
-
well i put a 5.1V zener in front of the damned regulator and it still climed to 6V!!!!!!!!, the MCU is still overheating. This is getting ridiculous, how many times will the PCB withstand these stupid mega's being removed and re-soldered ?
-
Where does the PWM output go to?
Also the voltage starts climbing because you are loading a 100mA Regulator with 300mA (at 22V input no less).
-
The PWM outpuit goes to the gate of a mosfet. I put a 5.1V zener in front of the reg and it still outputted 6+V which as far as I know is impossible.
I have 1.65K in series with the reg and the 5.1V zener in parallel, so there is no way the regulator is getting so much input voltage (it should in fact crash and go into limp mode at about 3V) and the current is being controlled.
just trying to remove the atmega to try yet again
-
How about actually measuring the voltage on the input of the Vreg.
And I mean where does the actual output of the PWM go to (as in the FET itself).
-
To the gate, the voltage from the zener goes straight to the reg input past a capacitor so unless a peice of track and a capacitor can become a boost converter this is getting bonkers. just trying another MCu after some more measurements on the reg
-
Well 5.14V on the zener, 4.67 after the reg. Looks pretty civil, will it all suddenly turn into a mysterious voltage multiplier when i put the atmega back in ?
-
What's the AC pk-pk on the regulator's output? I'm wondering if too high of a current-limiting resistor is causing the regulator to oscillate.
-
The voltage is 21V about 9mA through 1.65K. I think I'm going to remove the reg and run on the zener only
-
WHAT IS CONNECTED TO THE OUTPUT FROM THE FET, what are you actually driving with the FET.
-
A resistor, like I said before the problem arises when there is not even a program in the MCU, I guess the reg might be oscilating. I'm trying a zener reg now (originally it was going to be a primary stepdown / spike protection).
-
right the atmega still overheats (with just 9mA available). i am totally lost here. are there any basic connections this mcu requires ? at this rate it would have been faster to put a dip8 attiny in on a socket that I pre program
-
Never had such a problem with an atmega...
Can you show the schematic/pcb art, and maybe a photo of the thingy assembled?
21v is a bit on the high side, but for such a small load the regulator should work perfectly.
-
schematic and pcb attached
-
Have you considered the possibility that you're feeding a higher voltage than 5V into the micro from one of the other pins? Say, "Temp IN" or "PWM out"? (In the case of "PWM out", just try desoldering the transistor and see if that does it - you might have blown the transistor, which is shorting "PWM out" to the gate, and thus into the micro)
Because it sure sounds like you are feeding a higher voltage in; if you're seeing >5v and impossible power dissipation in the circuit when your regulator only gets a little power, and then the problem goes away if you remove the chip... I'd vote on the IO pin protection diodes conducting a higher voltage to Vcc on your micro, which backfeeds the regulator (which may well blow it too!).
Are you testing the circuit with only two wires hooked up to the board, namely Vin (to the reg) and gnd? If not, disconnect EVERYTHING else, including the ISP programmer, and see if it still does it.
Edit: Note that if your chip has ever done it (conduct enough power to heat it up via the protection diodes), it may be blown and will continue overheating even with the fault cleared.
Also, if this doesn't solve it, check EVERY pin on the micro for shorts to ground or Vcc - even if it's not programmed, it might (not familiar with AVR) be driving some pins.
-
The datasheet says AVCC must be connected always - it powers some of port C as well. Maybe there is some internal path causing the overload. If you don't care about ADC noise you can just wire it directly to VCC
-
Based on your circuit i cant see any obvious reason for the excess voltage. (Assuming your regulator is ok)
However, here's a few notes/questions that may help us narrow down where the problem is.
1) Connect AVCC to VCC, this shouldn't be the problem but your supposed to connect it.
2) Disconnect "Temp in" and "PWM out" from other things until you get the mcu working and 5V showing on VCC.
3) Did you get excess voltage with a new ATMega containing no code?
Yes = proves the problem is not to do with the mcu switching the fet and causing some sort of inductive spikes
No = Remove the fet and confirm 5V is present and the mcu is working (flash an led or something)
4) Check if you're getting this overvoltage issue with the ISP cable unplugged.
I very much doubt this is the issue but some programmers support 12V high voltage programming. It shouldn't be doing that but might pay to check its not trying to feed in 12V.
5) Do you by and chance have a large length of wire connected to this circuit? like 5+ meters
(eg, you might be building something that runs over a length of cable.) Any time you have a long length of wire and something that switching you can produce nasty higher voltages. I was once switching 24V through a fet from a micro and driving the signal into a 100 foot length of cat5. I was getting 160V ringing on the cable!
5) Can we have a photo of your circuit to check. (in case there's something wired up in a different way to your diagram /pcb and you haven't noticed it)
6) Put a 10k pulldown on the gate of that fet.
7) Double check that the VCC feed to your 2.8k and 10k resistors is actually from the 5V side of the reg and not the input side.
8 ) The copper tracks on your pcb, is that on the top or bottom of the pcb. I'm just wondering if there is a mirroring problem and the reg is connected up inverted.
(eg, reg pads are numbered for chip placement on bottom of pcb but the pads are on the top layer, or vise versa)
-
Well 5.14V on the zener, 4.67 after the reg. Looks pretty civil, will it all suddenly turn into a mysterious voltage multiplier when i put the atmega back in ?
The regulator has a 1.7V drop out voltage - you're not giving it much chance to regulate. I would guess that the regulator is unstable - what is R1 doing? I would also bypass C1 with a lower value cap - just to ensure there's no possibility of inductance creeping in.
-
Have you got the minimum input and output capacitance near the regulator, tied your regulator's power ground to one point (input and output capacitor grounds tied together at the regulator ground), and ensured you have decoupling caps generously placed around the ATmega?
-
Sorry, but that layout is pretty ordinary. The 0V line needs to be thought out better.
The 100n cap should be nice and close to the micro; right on the 0V and Vcc pins, not lurking off to the side on long traces.
As far as I know Avcc should not be left floating, even if not using the A2D. I assume you're using the A2D with that "temp in" anyway?
I also notice you have pins 1 and 8 4 and 5 on the 78L05 connected to 0V. The spec sheet says "NC" and i always take that to mean "don't connect to anything", not "can connect to anything".
-
Most of the time "NC" is physically not connected but yeah, always a bit risks using them.
It would be a good idea to check with the DMM if he has a spare reg IC handy.
They tend to say DNC for pins which shouldn't be connected to anything.
-
You might also consider what happens with the unused pins on the processor. I'm not too familiar with the ATMEL parts, but in general, allowing unused inputs (especially digital inputs) to float can lead to excessive current consumption and/or oscillation.
-
Floating inputs on a ATMega is fine. It's not good practice but wont cause this sort of catastrophic failure.
I'm fairly sure its a wiring/connection error somewhere, regulator input voltage is getting onto the mcu somehow.
Having the regulator soldered around the wrong way would do it and would be very easy to accidentally do, since the pcb was designed with the reg rotated 180deg.
-
The 0V routing is pretty horrific. People often underestimate the importance of good power and ground routing. The having the common 0V connection (wire) as the star point would be much better.
-
Agreed, but i doubt that's his issue.
I've never heard of bad grounding/power causing more volts to appear :) its usually the other way around.
Might cause oscillation that the DMM could misread as DC i guess.
Best to use the scope instead for debugging weird issues like this.
-
Thanks for all your comments guys. please note as per further up I have removed and bridged the regulator and swapped the 18V zener for a 5.1V one so no more power problems.
Yes the MCU overheats before being programmed
I have run this circuit on the DIP version of the MCU no problems.
With 5V through out the supply and sizable resistors from it to any I/O I fail to see where it is drawing so much power from.
-
How much load there is to the regulator, I think those 78xx-regulators need few milliamperes of output load to work properly.
Regards,
Janne
-
Can we get a photo of the actual pcb? top and bottom?
-
How much load there is to the regulator, I think those 78xx-regulators need few milliamperes of output load to work properly.
Regards,
Janne
I am using a zener now, still same result
-
Try 10-100nF on the pins of the processor supply - otherwise there is a relatively large loop back to C3.
-
photos attached
-
Where does that TEMP wire come from? Is it connected when the fault appears?
-
it's a resistor to ground
-
6) Put a 10k pulldown on the gate of that fet.
This was bugging me as well.
I don't think it's necessarily related to this problem, but it's a darned good idea anyway. When that IO pin is Hi-Z, the gate is effectively floating.
-
well it will always be working so long as the micro is on and no not to do with this problem. I'm redesigning based on a tiny85
-
1) The board is gunked up pretty good. May not be an issue, but... it lacks style.
2) The alignment of the TQFP package is quite a bit off. Who knows what's going on underneath.
3) If the chip gets hot instantly and can't be programmed anymore, it's probably dead. I've killed one or two myself by accidentally applying over-voltage (about 12V).
4) If you redesign it anyway, add the FET pull-down resistor. Otherwise it might switch on willy-nilly.
-
well it will always be working so long as the micro is on and no not to do with this problem. I'm redesigning based on a tiny85
I was thinking of the fact that the IO lines not involved in programming go Hi-Z while programming. (Unless I'm misremembering.)
-
well the pwm will be working all of the time, it is the sole purpose of the circuit. the PWM output will not be in use while programming and infact on the tiny85 version the pwm line will be a programming line too so i prefer to not put a load on it.
-
As you will be making a new board for a new design, leave copper on the bottom side and attach it to ground. I usually leave copper pour on the top side as well and try to route traces so that I don't split it too much. But don't leave unconnected copper pours - if some area becomes an "island" - either remove it (there are automatic options in Eagle and Kicad) or just add via to a bottom ground plane.
Flux is conductive. I once had a problem when my AVR board was not working till I cleaned the flux from it.
Regarding your voltage regulator problem -- I would guess something was very very wrong with the pinout of IC. Can you measure how much current is being drawn?
I'm not sure if unconnected AVCC might cause any problems, but datasheet explicitely tells you to connect it.
Read http://www.atmel.com/images/atmel-2521-avr-hardware-design-considerations_application-note_avr042.pdf (http://www.atmel.com/images/atmel-2521-avr-hardware-design-considerations_application-note_avr042.pdf) on how to do everything "right" according to Atmel.
-
well the pwm will be working all of the time, it is the sole purpose of the circuit. the PWM output will not be in use while programming and infact on the tiny85 version the pwm line will be a programming line too so i prefer to not put a load on it.
Once I had a problem in exact situation - just before etching a board I've substituted BJT's for mosfets and forgot to add pulldown resistors. No wonder I couldn't program the board when mosfets were randomly switching 4 high power IR LEDs 100mA each when powered from USB only - PC was resetting the USB port because of high current draw.
-
well the pwm will be working all of the time,
Presumably it will be working when the code is up and running. But what happens between power-up and running code? It's attention to details like this that make the difference between a good, reliable design and those dog-breakfasts of haphazard collections of components that sometimes work if the humidity is right. It ought to be considered as part of the design process, i.e. determining how a device gets to a working state - a step clearly omitted in a certain power supply that's currently taking up several threads!
-
1) The board is gunked up pretty good. May not be an issue, but... it lacks style.
2) The alignment of the TQFP package is quite a bit off. Who knows what's going on underneath.
3) If the chip gets hot instantly and can't be programmed anymore, it's probably dead. I've killed one or two myself by accidentally applying over-voltage (about 12V).
4) If you redesign it anyway, add the FET pull-down resistor. Otherwise it might switch on willy-nilly.
I agree, there is a lot of flux on there. I have encountered problems before with flux being conductive.
I also agree about the chip placement. That definitely could be the problem.
I also agree with needing the pull-down resistor. With nothing attached to the gate, the internal leakage current will slowly charge it up. You will get a fet that is only partially turned on, and it may cause overcurrent problems, or it may overheat and burn up.
-
yep the mosfet needs a gate pulldown, even if its only 50k.
Sure, it may work without it, but he's just asking for problems later on.
-
It looks like theres a bridge on the reset pin ,what effect would that have ?
-
The short shouldn't cause a problem, unless..
- PC5 data direction is set as output
- The programmer is driving reset to +12V (the reset pin is special and able to handle 12v but other pins cant)
There also might be a short between 20 and 21 (AREF and GND)
If the MCU is configured with the internal ADC reference tied to AREF that would be a short to GND. So might explain increased current.
-
uh, i am a clod, fault found, once it started to happen to my tiny85 version as well it was obviosu there was a fault with my wiring: I had the sensor line on the V+ in (22V) rather than GND.......
-
well, I've made myself two debugging rules for cases like this:
1. is it turned on?
2. is the pinout /connections correct?
takes out 95% of cases :-/O
-
uh, i am a clod, fault found, once it started to happen to my tiny85 version as well it was obviosu there was a fault with my wiring: I had the sensor line on the V+ in (22V) rather than GND.......
LOL - That's exactly why we asked about the external connections. :-DD
-
22V :o :o
I'm rather amazed it didn't just decide to release the magic smoke!
-
Well the built in protection was holding it down to no more than 10V by which time i was shutting it off, it usually got to 7-8V before i cut it and retried