Atmega328p-au Can't stop fryin them - Page 1
Forum section: electronics / beginners

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 06:45:00 am
content: I recently bought 4 atmega328p-au off of digikey and the first one i put on my pcb wasn't working. tracked this down to crossing leads on my pcb layout... DOHmade a quick bodge so i could continue prototyping and i was in like flin and was able to read the chip. when i went to program it it failed on verification. after that the tl866a i have kept giving overcurrent protection whenever i would try and read or write. If i let the chip sit for a minute i could read the chip again. So i thought this to be a power delivery problem so i hooked it up to my bench supply and it sure was taking alot of current. about 50 ma. then shot up and fried the chip. at that point i decided to fix my pcb layout. actually run some error checking on it this time. and send out for another batch of pcbs.Fast forward a week and i get the new pcbs and this time i decide not to solder the 80+ smd components by hand and just solder the filtering caps for the atmega and the icsp header. still the same issues. if i let the chip sit for a bit i can read it and get halfway through verification on the programming before it erroring. as i have gone through 3 chips so far i decided to take it slow with this last one since i will have to wait a while before i can get more. (already ordered some more) did i maybe just get a set of bad chips?i have another prototype of this circuit working using the dip package and it has been working flawlessly in daily use for about 2 months now. really wishing i stuck with the dip packages for my design as these Atmega328p-au's are making me bang my head against the wall

author: Fungus
author_rank: Super Contributor
timestamp: July 14, 2017, 06:57:24 am
content: Did you bother to put your finger on it and see if it's hot?

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 07:38:57 am
content: yeah. it gets warm. until it gets fried. and when i mean it frys i mean it lets the magic smoke out.

author: Ash
author_rank: Regular Contributor
timestamp: July 14, 2017, 07:59:35 am
content: Silly question, but did you check that the pin out didn't change between DIP and SMT device - looks like its a TQFP, they are likely to have different signals on different pin numbers. Also, did you get the direction on pin numbering correct? I assume you based your schematic on your DIP prototype..Are all the power/ground pins connected? Have you shorted out any IO pins and set them up and outputs accidentally? Is your power supply at an appropriate voltage (measured it)?Bit hard to tell whats happening without schematics and layout..Ash.

author: sleemanj
author_rank: Super Contributor
timestamp: July 14, 2017, 08:01:22 am
content: Quote from: FL0WL0W on July 14, 2017, 06:45:00 amUnlikely, but of course not impossible.Without schematic and at least images of your PCB we would all just be blindly guessing.

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 14, 2017, 08:02:20 am
content: Quote from: FL0WL0W on July 14, 2017, 07:38:57 amschematic and pcb picture will tell the story...

author: uwezi
author_rank: Unknown
timestamp: July 14, 2017, 08:12:47 am
content: You must have a serious problem in your schematic layout - there is no other possible explanation!

author: Muxr
author_rank: Super Contributor
timestamp: July 14, 2017, 08:18:47 am
content: Quote from: FL0WL0W on July 14, 2017, 06:45:00 amI am surprised your PCB design software even let you do that. KiCad for instance won't even let you lay down a trace if it's connecting to a trace it's not supposed to connect to.Does your bench PSU support current limiting? Try limiting current to 20mA. It will probably save you from blowing up more chips.Take one of your unpopulated PCBs and study the pinout of the chip:Measure continuity between VCC and GND pins and all the other pins and look for shorts.Would be easier to help you if you could share your schematic and layout.

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 12:26:06 pm
content: thats what i have been doing with this last one is limitting the current on the psu. Here are some images of the schematic and pcb layout. note that the only things i have on the board are the icsp header, the atmega, and the 2 caps and resistor to the right of the atmega.

author: amspire
author_rank: Super Contributor
timestamp: July 14, 2017, 12:40:46 pm
content: Why are pins shorted on the Atmega328P in the layout? For example pin 3 (GND) and pin 4 (Vcc)?Three other pin pairs are shorted. If that is the problem, the Atmega's are probably fine.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: July 14, 2017, 12:49:19 pm
content: MEGA8-AI <> 328P-AUIt looks like pin 4 and pin 21 are connected via the trace underneath.VCC and GNDAnd Pin 3 &4 likewise GND & VCC.Try DipTrace and check your design for constraint conflicts to ensure good separation. Some of your pads are so close it would be difficult not to bridge them (if they weren't already wired together)On an unpopulated board check continuity between the pins.

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 12:58:53 pm
content: Uhhh just a low quality image of the board. Was in a rush to post them before work and didn't notice that. I assure you that all of those pads that look connected are not. The pinout between that in the eagle layout and the atmega328p-au are the exact same. Checked that a few times. Also checked all of the pins with a magnifying glass as well. Will check continuity between pins after I get off work. Thankyou for all of the replies

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 14, 2017, 12:59:19 pm
content: still difficult to see, a lot of short in the pcb picture, you have vcc pin shorted to the next pin, icsp pin5 got shorted to the next pin, its shorted everywhere.. 2cnt advice... check continuity for all pins to power rail IC3 IC2 that is not supposed to be there, no ground break, and read the atmega datasheet for any precaution during wiring, fwiw... btw trace short vcc to gnd pin on pcb should not affect the mcu as it will be powered up from 0V (current will go outside the mcu, not from inside). the OP your symptom indicating current go from inside, so probability there are pins shorted to power rail, or mcu is getting high voltage, ymmv...

author: NivagSwerdna
author_rank: Super Contributor
timestamp: July 14, 2017, 01:19:06 pm
content: Hm... I can see shorts via the traces(You are correct about the 328P-AU versus MEGA8-AI power/ground pins though)

author: Yansi
author_rank: Super Contributor
timestamp: July 14, 2017, 02:38:51 pm
content: You all are just being picky... as was already stated, this is a just poor image render. Look elsewhere than for these nonexistent shorts.To the OP: Export the image at 600DPI or more, otherwise it is useless for verification. If you need to make the image smaller in resolution, use then a high quality resampling algorithm.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: July 14, 2017, 03:09:50 pm
content: The OP might have put the chip in the wrong orientation.... we have little to go on really... especially with bogus pictures.

author: BrianHG
author_rank: Super Contributor
timestamp: July 14, 2017, 03:11:43 pm
content: How many volts are you feeding your regulators?The 15v stated in your schematics is right on the 'RED' line as specked in the LM1117-xxx-x data sheet. Any AC linear transformer rated for 15v DC will easily go over this threshold depending on your mains.I would be powering this circuit with optimum around 9v DC.

author: knotlogic
author_rank: Regular Contributor
timestamp: July 14, 2017, 03:14:21 pm
content: Do those chips have an exposed pad underneath? And is there any exposed trace/via where it sits?

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 05:43:41 pm
content: I will get a better image of the pcb after I get off work. Sorry about that. Atmega is definitely in the correct orientation since I CAN communicate with it over icsp. The current just starts to run away after about 5 seconds of being on. Not powering it with the regulators currently. The supply is 15v because that's the closest available in eagle and honestly it's just naming. This goes in a vehicle so the voltage is more around 14.4v. Even so the lm1117 has a higher voltage rating and those are what I plan on using. The atmega 328p I am using has not pad underneath. If it did it would definitely cause problems with the bias underneath the chip

author: NivagSwerdna
author_rank: Super Contributor
timestamp: July 14, 2017, 07:37:37 pm
content: Quote from: FL0WL0W on July 14, 2017, 05:43:41 pmThat would be good.Can you measure the R between pin 3 & 4? What do you get?Does this happen when there is nothing else connected to the board?I think there must be something, which will subsequenty turn out to be obvious, wrong! Divide and conquer will be the best approach.

author: mariush
author_rank: Super Contributor
timestamp: July 14, 2017, 08:40:17 pm
content: not so much a solution but some suggestions..Change the linear regulators to something that's not as sensitive to maximum input voltage and is less picky about capacitance at the output (lm1117 requires at least 0.1 ohm esr on the output capacitors and i think there's some minimum load requirements)Use something like AP2204 for example if you don't need more than 150mA, which work with up to 24v and are in SOT-89 smd footprint (or others) and work with regular ceramic capacitors on the output, so they'll be cheaper and take less space on the boardfixed 5v :https://www.digikey.com/product-detail/en/diodes-incorporated/AP2204RA-5.0TRG1/AP2204RA-5.0TRG1DICT-ND/4505158fixed 3.3v :https://www.digikey.com/product-detail/en/diodes-incorporated/AP2204RA-5.0TRG1/AP2204RA-5.0TRG1DICT-ND/4505158adjustable sot-23-5 :https://www.digikey.com/product-detail/en/diodes-incorporated/AP2204K-ADJTRG1/AP2204K-ADJTRG1DITR-ND/4470811Your design also seems to be a perfect case for using resistor arrays / networks .. you have 11 10k resistors by the connector and 8 10k resistors by the chip.Instead of using 19 10k resistors you could just use 5 4x10k resistor arrays, or you can use 8 element 10k resistor arraysex :4 isolated resistors in 1206 footprint, 0.05$ for 10pcs, 0.02$ for 100 :https://www.digikey.com/product-detail/en/panasonic-electronic-components/EXB-38V103JV/Y9103CT-ND/256604Use 3 by the connector (leave one resistor unused), and 2 by the chip. With a bit more difficulty (in routing) you could even one or two of these resistor arrays by the ESP12 chipThey're not that much more expensive compared to individual smt resistors. If you go for 0603 or 0805 they're like $0.005 if you buy 100 each , so basically 0.02$ for 4 compared to $0.05 for a 4 element resistor array, or less if you buy more than 10pcsTurning the atmega chip 45 degrees to the left may also be a smart thing, would make routing a bit easier

author: KL27x
author_rank: Super Contributor
timestamp: July 14, 2017, 09:36:42 pm
content: The easiest thing to doStep 1. try to program your DIP version, again. Just to verify the programmer isn't damaged/faulty.Step 2. Cut all the traces on your board which short pins, and try it.If that works, then goto A. If it doesn't work, goto BA. look up the pin functions of each of your shorted pins. Check datasheet for any obvious problem. Default startup state, et al. Do same for errata. If you find nothing wrong, then repair each of your cut traces, one by one until the fault returns. Then look at the datasheet again, more deeply in area of focus of the problematic pins.B. Either bodge up an icsp header onto a bare chip, or just cut all the traces on your board except for the ICSP traces. Maybe use a board from the first batch. And try again.If the smd version and the DIP version are both wired exactly the same, perhaps there is silicon errata, or perhaps you have done something wrong, but the DIP version is able to withstand the problem without crossing over into thermal runaway; whereas, the QFP succumbs.Because the programming gets halfway done, it's obvious that there isn't a short between power and ground on your board. And if the chip is the only thing on the board, then it seems just maybe possible that a pin conflict between a hi and lo output could fry your chip. Perhaps while programming, or error in code. Or errata. But finding it physically with step A can be a lot faster than than reading 400 page datasheet and errata sheet and code. Verifying a needle is actually there is a good idea before digging into the haystack. When something so strange and unlikely happens as this, I am inclined to prove it. To remove all other variables to show that the chip will die just from programming. Then I have something. Until then, it's human error.

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 10:01:46 pm
content: Very good suggestions kl27x. I will try that when I get home. For 3.3v for the esp8266 It needs much more than 150ma but for the 5v rails that is probably enough. I have had 0 problems with the current regulators running my car for the past 2 months but I know there is a bit to be improved on the psu. I modelled the low pass filter design in spice to comply with sae requirements.

author: bitseeker
author_rank: Super Contributor
timestamp: July 14, 2017, 10:08:16 pm
content: Very curious to see what's causing this. It sure sounds like a GPIO gone rogue, sinking when it shouldn't or way more than intended. I like KL27x's suggestion to clip all the traces around the uP to isolate it and, provided the anomaly then goes away, reattach systematically.

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 11:24:49 pm
content: i've clipped all of the traces but it is stilll happening. going to dremel off the entire rest of the board except the icsp header caps and ic. here is a higher res photo of the board layout

author: Ian.M
author_rank: Super Contributor
timestamp: July 14, 2017, 11:48:57 pm
content: I'm assuming you've already beeped out a bare board with a continuity tester to eliminate the possibility of copper whiskers bridging pads or tracks due to a board manufacturing fault, and systematically checked the board against the pinout diagram, only hilightiing each pin of the diagram after fully checking its connectivity to other parts and rails.I'm thinking possible ESD damage.How are you soldering them?If you are using an iron, is the tip effectively grounded?If its not grounded, what's the leakage current from tip to ground with the iron hot?Are you working on a dissipative ESD mat or some other surface?Is the board isolated during assembly?Another possibility is the regulators oscillating. See LM1117 datasheet. 10uF Tantalum is the MINIMUM recommended output capacitance and a 10uF tantalum input capacitor is recommended if its far from the PSU bulk decoupling cap. You only have 100nF input decoupling for both regulators (after R1) I'd recommend bodging in a 22uF cap there.

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 11:52:44 pm
content: ok so i dremelled away everything but the board. i can read the chip id just fine. but trying to read/write more than that i get overcurrent protection. so i tried another suggestion and wired up a dip atmega328p on the breadboard and was able to read/write with zero issues. i feel as if i have eliminated all possible issues other than just a bad batch of atmegas. in other good news i just realized my board manufacturer gave me 2 extra boards this time.

author: FL0WL0W
author_rank: Contributor
timestamp: July 14, 2017, 11:58:06 pm
content: thanks for the reply Ian.M ESD is something i have not thought about. after inspecting the power connector for my soldering station i discovered the ground pin had been pulled outThis could very likely be the issue. i have a static mat but i have not been using it. i guess i really should take esd into more consideration than just grounding myself before touching anything. my desk is glass as you can see from the previous picture. as for the regulator, they have not even been connected so that is not the issue but i do appreciate the recommendation. i will probably put another electrolytic on the input stage. however this exact circuit has given me 0 issues in the 2 months of daily 2+hr use.

author: sleemanj
author_rank: Super Contributor
timestamp: July 15, 2017, 12:05:02 am
content: Remove the IC. Dead-bug or solder onto a breakout and see if you can program it there, without your PCB in the mix. That way you will confirm it as a problem with the IC and not (what is left of) the PCB.

author: KL27x
author_rank: Super Contributor
timestamp: July 15, 2017, 12:06:43 am
content: I assume you cut the traces under the chip? And the intentional bridge between 3 and 5? That one is hard to see in your photo; it looks intact.Also, it would behoove you to NOT connect external power. Or to at least verify it, or use a lab supply, if your programmer cannot supply Vdd.I'm not sure what iron you use. It is going to surprise the heck out of me if the problem turns out to be ESD.I've never used an ESD mat or a wrist strap. And my iron is intentionally ungrounded.. grounded thru a 1Meg pulldown, anyhow. I solder hundreds of SMD microcontrollers a month. It would be quite a coincidence if you were killing the SMD chips but not the DIP ones. Too much heat when soldering, maybe?

author: FL0WL0W
author_rank: Contributor
timestamp: July 15, 2017, 12:32:18 am
content: kl27x it has to be either a bad batch of Atmegas or ESD. sorry for low quality images again but the intentionally link between 3 and 5 is still good. when i get the other ics in that i have ordered i will let you know if it works after all esd precautions. i have a really big suspicion it is bad atmegas or esd.

author: Ian.M
author_rank: Super Contributor
timestamp: July 15, 2017, 12:46:13 am
content: I'm also assuming the MCUs were properly packaged on receipt in an antistatic bag.From your description, ESD damage is fairly unlikely (but not impossible) - the input protection diodes of most MCUs can tolerate moderate zaps without significant degradation (though sleep mode minimum power consumption may be affected by any ESD event).However, if there was any ground path to your PCB during assembly and you had used a mains element soldering iron without a grounded bit, you could have been frying pins with the element to tip leakage current. As you are using a soldering station, its probably a low voltage element, and the work surface is non-conductive so again this is extremely unlikely. Its easy enough to check for - with the grounding defect you found reinstated, check the leakage current between the tip and a good ground, observing it long enough for the iron to come up to temperature and stabilise. Also check the voltage on the tip. Don't forget to re-fix the grounding defect afterwards!I would recommend maintaining the capability to work with full ESD precautions (ESD mat, wrist strap, ground point, extra ESD lead with clip end for equipment chassis connection. tested ground continuity to your soldering iron tip, + static dissipative tip on your solder sucker, and snips with static dissipative handles) even if its too much of a PITA to use the wrist strap and *ONLY* ESD-safe tools during routine prototyping. Then at least you can swap the chip and be certain you haven't ESD damaged it. If you don't have an ESD safe solder sucker use braid, and if you don't have ESD safe snips, keep a finger on the jaw pivot while using them

author: KL27x
author_rank: Super Contributor
timestamp: July 15, 2017, 01:12:40 am
content: QuoteAnd all the others under the chip, I presume, as well.Cutting the entire board, which was unpopulated to begin with, but leaving these intentional bridges intact is missing the point. But if you are convinced you got bad chips or ESD, then your problem is solved... for now.

author: FL0WL0W
author_rank: Contributor
timestamp: July 15, 2017, 02:15:53 am
content: Well it's not an intentional bridge but an intentional link. Vcc to vcc. Only thing that is left connected to the board are necessary stuff to connect to icsp

author: Ash
author_rank: Regular Contributor
timestamp: July 15, 2017, 02:38:41 am
content: Here's a thought..What is your power supply? Is it grounded? If its a switch mode thing, it has the potential to float up to about 1/2 mains potential because of EMI filtering caps in it unless you have it grounded. Perhaps you are inadvertently zapping the Atmel when you connect the programmer (grounded through your PC)?I learned this the hard way.. a particularly "well filtered" (large caps = higher current available) plug pack (wall wart) I was using to rung something with expensive push buttons with LEDs.. I zapped myself then and LED stopped working..then I did it again..then I worked out what was happening..Ash.

author: KL27x
author_rank: Super Contributor
timestamp: July 15, 2017, 03:20:39 am
content: QuoteOh, ok. I saw where you had connected something like 3 pairs of pins. I have never used 28 pin micro with so many shared supply pins, but I have intentionally shorted pins before (so I don't have to switch pin functions in the code, to do less code and to try to get ADC read faster). I thought you had some regular I/O pins connected. My mistake.All the potential problems listed sound reasonable, but right now I put external power supply in the lead, because the chip ID's and programs halfway before it cooks itself. Perhaps power supply is unstable.

author: djnz
author_rank: Regular Contributor
timestamp: July 15, 2017, 04:00:53 am
content: So I don't want to tempt you into falsely thinking that the problem is with the ATMega and not your board if that's not actually true, but have you seen this:https://www.sparkfun.com/news/350Do you have a different board that is an already known good layout that uses the same chip, same footprint? You could try using this new chip on that board. Or make a dead bug style circuit to test out the chips. If I remember right, these 'p' versions (328p) come from the factory with the internal oscillator enabled. To program them for testing, you'll only need to wire up VCC, GND, RESET and the programming pins which should be doable dead-bug style.

author: sleemanj
author_rank: Super Contributor
timestamp: July 15, 2017, 04:30:54 am
content: Quote from: djnz on July 15, 2017, 04:00:53 amHe can read the ID so it's not a slug.Certainly could be damaged/QC failed from the factory though if it was purchased back-channel.

author: Ian.M
author_rank: Super Contributor
timestamp: July 15, 2017, 04:54:51 am
content: Quote from: sleemanj on July 15, 2017, 04:30:54 amThe O.P. said they were ordered from Digikey, and its fairly unlikely that Digikey's supply chain from Microchip (Atmel) is contaminated. Apparently they have procedures in place to prevent stock from a previous customer, who was scamming Digikey by ordering genuine then returning fakes/rejects for credit, going out to a new customer. Seehttps://www.digikey.com/en/help/counterfeit-product-policy

author: FL0WL0W
author_rank: Contributor
timestamp: July 15, 2017, 06:12:17 am
content: To clear up some confusion. I have used both the programmers psu and a Tektronix lab bench supply with exact same results. Noting this all works fine on known good dip atmega328p in a breadboard

author: djnz
author_rank: Regular Contributor
timestamp: July 15, 2017, 07:49:00 am
content: Just checking the schematic by building the same circuit with a DIP version of the chip is only half the work.1. Faulty schematic -> possibility eliminated by checking with DIP ATmega2. Faulty batch of chips -> check this by using same chip (same lot, shipment, footprint) on another known good board / deadbug harness.3. If the chips come up as not faulty, then it has to be your PCB.3a. Either you submitted a faulty PCB design to the manufacturer and the manufacturer faithfully produced them or3b. Your design was fine, but the manufacturer produced faulty PCBs.You will have to investigate all this to get to the bottom of the problem. Note that a good schematic does not automatically translate into a good PCB.

author: FL0WL0W
author_rank: Contributor
timestamp: July 15, 2017, 05:45:04 pm
content: 1. Schematic made in a dip version of the board (works therefore schematic good)2. Dip chip on breadboard hooked up to program (works therefore programmer not faulty)3. Board populated with only smd atmega and if icsp (doesn't work)4. Board populated with only smd atmega, supporting caps and resistor (doesn't work)5. Board cut down to literally only the atmega and supporting caps and reset pullup resistor. Followed all traces to the icsp and verified good. (doesn't work)Points 2-5 all done with both programmers psu and a Tektronix lab bench supply verified with a fluke meter.Point 1 is in service and has been for 2months daily 2+hr use.I feel as if I have troubleshooted everything just about as far as reasonable and point 6 will be new atmegas following all esd precautions. I will keep this updated if I find anything elseThankyou for all of the replies and help.

author: Ian.M
author_rank: Super Contributor
timestamp: July 15, 2017, 07:39:34 pm
content: Grab a cheap Arduino Nano clone or similar with the same chip. Load test firmware to toggle a suitable pin to show its alive on your board. Desolder it using Chip-Quik so you don't excessively thermally stress it. Clean it up with flux and wick then solder it to your board by the same method as before but with full ESD precautions. Clean up the Nano board with flux and wick so its ready for a new chip.If the ex-Nano chip works on your board you know it was an ESD or other process problem (or low probability - bad chips). If it doesn't you've either got a process problem or a board fault you've missed. At that point you'll need the new chips. Put one on the Nano board. If it works you must have a fault on your board. If it doesn't you've got a serious process problem.

author: metalhead777
author_rank: Newbie
timestamp: July 17, 2017, 07:06:28 am
content: Didn't read everything, sorry, but I'd suggest checking the symbol pinout in the eagle library with the datasheet, and match that to the footprint.It has happened to me before, that a symbol had two pins switched.If you already did that, I apologize.Gesendet von meinem Moto G (4) mit Tapatalk

author: FL0WL0W
author_rank: Contributor
timestamp: July 29, 2017, 02:44:02 am
content: ok so i got a new set of chips today but unfortunately that was not the issue as many of you predicted. I also got my first digital scope today so i decided to look at what my programmer is putting out. The vcc supplied by the programmer seems to be good at just above 5v. but when i look at the signal coming from sck on the programmer it appears that the von is about 3.7V but it also has some voltage spikes up to 4.7v and down to -1.2v. could it possibly be my programmer that is breaking these atmegas? MOSI goes up to 3.8V with no spikes. i think the programmer is the only thing i have not rulled out. maybe the atmega328p-au is just more brittle than the dip variant. anybody recommend a programmer?

author: 3db
author_rank: Frequent Contributor
timestamp: July 29, 2017, 03:10:23 am
content: There's USBASP or USBTINY.You can also use an Arduino (Arduino as ISP sketch).If you have a genuine Arduino UNO you can also use the Atmel Flip program to re-program the small MCU that does the USB to serial.Check outhttp://www.gammon.com.au/for more info Arduino as programmer.3DB

author: uwezi
author_rank: Unknown
timestamp: July 29, 2017, 10:53:15 pm
content: Quote from: FL0WL0W on July 29, 2017, 02:44:02 amThe package should not matter since it is exactly the same chip inside the packages (unless you get fake ones...).But what worries me is that you see NEGATIVE voltages as high as -1.2 V on any digital line. This should be impossible, since it would be clamped by the internal protection diodes to a max of -0.6 V UNLESS you are really pushing current through these diodes. Furthermore, it seems that your voltage span on your signals -1.2 V to 3.8 V is the full 5V span you would expect from 5 V CMOS logic signals, but it is SHIFTED with regard to your ground level.Are you sure that the programmer is correctly connected to digital ground of your ATmega board? Or let me rephrase this - I am pretty sure that this is not the case.

author: GBowes
author_rank: Contributor
timestamp: July 30, 2017, 01:49:48 pm
content: Maybe a dumb question but sometimes we miss seeing the obvious. Have you checked the actual connections from your programmer to the ISP connector? Your image shows you are using a red wire for ground. Electricity is color blind so this doesn't really matter but it did catch my attention.If you have the connections rotated, VCC would be fed by your reset line (through 10K) and would power the chip. Not sure how the ground is made... maybe by the programmer through the MISO connection... Then you have the chip's MISO grounded which will not make it happy if it tries to make it go high.Graham

author: FL0WL0W
author_rank: Contributor
timestamp: July 30, 2017, 05:10:17 pm
content: The -1.2v was only a voltage spike and was not the ground level of the sck. also note that this measurement was made with the icsp not connected. i was measuring the open circuit voltage of the sck. i also overnighted a usbtiny programmer but i couldn't even get it to read the chip since there is a constant 5v coming from the programmer even when not reading or writing so the chip was dead before i figured out how to use avrdude (I know this cause the magic smoke escaped). I was able to read and write the dip version of the atmega328p on my breadboard with the usbtiny. I am at my wits end with this and really just wish i could figure out this problem.I feel as if i have tried everything to make these work.

author: amyk
author_rank: Super Contributor
timestamp: July 30, 2017, 05:34:21 pm
content: How long is the lead from the programmer to your board? Does it happen to also be coiled around something? The only consistent theme among all your posts is that the MCU and the board seems to be OK until you start using the programmer on it.Keep your programming leads as short and straight as possible, and if your programmer has any clockspeed option, set it to the minimum.If I were you, if that still doesn't work I'd wire up the simplest manual programmer, connect it to the board, and input an LED-blinker by hand:

author: KL27x
author_rank: Super Contributor
timestamp: July 30, 2017, 08:19:39 pm
content: QuoteI don't understand why 5V on the chip should be expected to harm it? Is there something in your circuit that can't stand 5V? The chip seems to have Vdd range between 1.8 and 5.5V, no?Everything so far boils down to:DIP/breadboard/earlier board revision WORKSvsQFP/latest board MAKES SMOKESo to figure out of it's your board vs the difference between device packages, you still have to try two more things.1. Program the DIP version from your latest board. Using fly wires.2. Program the QFP version from the breadboard. Making breadboard adaptor and fly wires.If there was a vote, 99% of us would think there's something wrong with your board. For you to have two programmers that somehow fry a QFP but work with DIP is pretty much like winning the lottery. I don't think that will happen to the rest of us even the first time. There is not that much of a difference between the chips, what is on the other side of the bond wires. But you seem pretty convinced your board is fine. So perhaps one or both of those experiments will produce some result that will change your mind and help you find the fault.The process of excluding one variable at a time will help you find faults, in general. The kind of bugs/problems I can create in software and hardware know no bounds. I have a lot of practice in this technique. Wiring QFP chip by hand is a pain, but I bet you can do it faster than spontaneously figuring out what is wrong with your board. And faster than getting yet a third programmer in the mail. We are all curious what causes a board to be ID'd and to start programming, but then burning out halfway through the process. You have a clue in front of you, but it won't necessarily make any sense unless you step through it one bite at a time. An analogy is having a short between power and ground. You know it's there. But even on a small board, you might never find it. But once you start cutting the power rail in order to narrow down your focus, you will look at the remaining area with a new set of eyes that sees things differently. Even just knowing that one half of the rail isn't showing a short verifies your test procedure/equipment and is an important sanity check.Everyone wants to be the guy that finds a unicorn. I don't even begin to entertain such a notion, until I feel confident I have exhausted all other more plausible explanations and have eliminated all other possible variables. And if I should ever find something so curious, it is perhaps going to be more interesting to me than my board.*Re:-1.2V, I think this is probably a red herring. It might be an artifact of how your probes are tuned. And even if it were there, this tiny spike would not burn up your chip. Your chip's ESD diodes would clamp this to ~-0.3ishV, and I bet it could handle such a tiny -1.2V spike til the cows come home.

author: MarkS
author_rank: Unknown
timestamp: July 30, 2017, 10:37:51 pm
content: I came here to make EL27x's #2 suggestion. Solder wires to the necessary pins to power and program the chip, plus one I/O pin to connect to an LED. Connect this to a breadboard and test. If this works, it's your PCB. If not, it is either the chip or the programmer. I'm betting on the PCB.

author: uwezi
author_rank: Unknown
timestamp: July 31, 2017, 11:02:12 pm
content: Quote from: KL27x on July 30, 2017, 08:19:39 pmThat's what confuses me. The ESD diodes will clamp this voltage spike - there should never be any visible spike that large on any pin!

author: uwezi
author_rank: Unknown
timestamp: July 31, 2017, 11:03:22 pm
content: Quote from: FL0WL0W on July 30, 2017, 05:10:17 pmNow I am even more confused - your QFP Atmega generates spikes on the SCK pin when the programmer is not connected?

author: FL0WL0W
author_rank: Contributor
timestamp: September 27, 2017, 06:06:54 am
content: Ok so i finally got around to buying a zif socket for the tqfp package and breadboarded it up and would you look at that. no problems reading writing to the board...... didn't even have any capacitors connected to the power rails. hmm it has to have been something in my PCB design as all of you suggested... I still would like to know what would have caused this but fortunately for me i reformatted my computer recently and lost the eagle files for it anyway.I think i will try to make a new design and avoid having vias underneath the chip as i feel that may have been an issue some way some how.

author: LukeW
author_rank: Frequent Contributor
timestamp: September 28, 2017, 10:18:17 am
content: - Decide which chip you want to use (e.g. ATmega328P)- Decide which package you want (e.g. TQFP, QFN)- Get the datasheet, fire up the software of choice and draw a schematic symbol in a library for this device, make sure it's correct.- Draw the PCB land pattern for the chip, make sure it's correct, and set up the symbol-footprint pin mapping for this device.- Ensure that the land pattern you've drawn has a recognisable orientation marker.- Double-check that the pin mapping in the library device is correct.- Don't just assume that you can just get some random internet-created library and it will be correct.- Draw the schematic correctly, check the schematic, use your new library.- Run an ERC and make sure there are no errors, or minimal errors if you're careful about vetting acceptable errors.- Do the PCB layout, run a DRC, make sure all nets are routed and there are no DRC errors.- Buy silicon from a reputable distributor, just in case of dodgy ones.- Make sure the device is oriented correctly when soldering, and there are no shorts or open circuits.- Basically, the software you use has tools built into it to ensure that the layout matches the netlist matches the schematic, so take advantage of them, and also make sure you use your ERCs and DRCs. Otherwise you might as well just be making the layout in Microsoft Paint.

author: FL0WL0W
author_rank: Contributor
timestamp: September 28, 2017, 07:34:08 pm
content: Yeah i mean through the pcb layout i followed every individual trace to confirm it was where it needed to go. i also ran all of the ERC and DRC checks and they came back good. i think it has to do with the vias underneath the ic getting possible solder bridged to the pin it was closed to.

author: KL27x
author_rank: Super Contributor
timestamp: September 28, 2017, 09:00:42 pm
content: I'm just impressed you came back to post this. A lot of people can't admit when they're wrong. I've heard of people using vias to improve heatsinking of the center pad. The usual thing is to just make sure the vias are small enough they don't suck all the solder out of the joint. When the center pad is too dry, it prevents the chip from aligning itself. Like two plates of glass stuck together with only a few drops of water. The large center pad sucks the chip to the board and squeezes the solder in the smaller pads out the sides of the chip.

author: FL0WL0W
author_rank: Contributor
timestamp: September 29, 2017, 04:08:23 am
content: well the thing is there isnt a center pad on the chip or that would obviously be the problem. i think that maybe solder may have bridged between the via and the pad. but really it is all still a mystery as to why the pcb did not work since everything seemed to check out. so i guess it is a partial admission to being wrong. it could still possibly be to overheating when soldering or some kind of electrostatics going on but i just need to get around to designing a new pcb.