Atmega328p woes from JLCPCB SMT order - Page 1
Forum section: electronics / general

author: blackstealth
author_rank: Newbie
timestamp: February 03, 2021, 07:21:54 pm
content: I put an ordered on Jan 8th this year for JLCPCB to build some circuit boards and had their pick and place service solder the popular Atmega328p part on. The Atmega328p accepted a flash no problem, but that's all they would do. I tried toggling a simple pin, like a blink sketch, no go. I tried a simple "Hello World" serial test, and only 4 out of the 10 would pass that test. I spent days going mad trying to figure out what could possibly be wrong.I removed their 16mhz crystal, and put another 16 mhz crystal that is a known working part. No improvement.I replaced the Atmega328p and replaced it with one I had in stock, and presto, it worked perfectly.I go ahead order new Atmegas from mouser and the problems are all gone.I sent a message to JLCPCB using the "Quality Complaint button" but it's been over a week and no response from them.Photos: I removed the JLCPCB Atmega, and replaced it with one I had in stock.I am worried that the hot air flow will make components fly off, so I tape them down with yellow kapton tape and remove all JLCPCB atmegas off.Mouser's atmegas are soldered in and JLCPCB's atmegas are all removed.Since JLCPCB did not get back to me at all, I am too afraid to use their atmega328p again. De-soldering / re-soldering those were a pain for me, wasted another day on that. Lesson learned, design PCB to use through hole atmegas and order microcontrollers from mouser.

author: wraper
author_rank: Unknown
timestamp: February 03, 2021, 07:37:27 pm
content: Post a close photo of cleaned IC you removed. How you programmed fuses, what load capacitance do you use?QuoteAnd what's the point? They are order of magnitude more difficult to replace. At places you used Kapton tape there was no need for it. Plastic connector is the only place worth to cover.

author: Psi
author_rank: Super Contributor
timestamp: February 03, 2021, 07:42:14 pm
content: Also are you sure you got atmega328p and not atmega328pbTrap for young players.Usually the last letter on parts doesnt matter much, except when it does lolCould be fake or just recycled without having every setting reset to stock.I tend to stay away from very popular chips if possible. Fakes and rejects are more common on popular chips

author: blackstealth
author_rank: Newbie
timestamp: February 03, 2021, 07:53:29 pm
content: Close up pictures. I've been using atmegas since 2010. Load capacitors 18pf. Fuse set to external full swing.

author: Ian.M
author_rank: Super Contributor
timestamp: February 03, 2021, 08:09:54 pm
content: Take a cheap Chinese Arduino Nano or Pro Mini clone, and check if its fake so you know if the MCU you are going to desolder is any good. You'll find the fake Atmega detection sketch linked fromhttps://www.eevblog.com/forum/microcontrollers/arduino-pro-mini-two-copies-have-different-sleep-currents/msg3232812/#msg3232812, which also tells you how to interpret the results.Next, desolder the chinese Arduino's MCU, and replace with one of your JL PCB ATmega328P chips that passed your serial 'hello world' sketch. Flash it with an Arduino bootloader, and run the fake ATmega detection sketch on the JL PCB chip.That should give you a pretty good idea what's doing on. As your board supports serial comms you could also try the fake detection sketch on a known good chip for comparison.

author: phil from seattle
author_rank: Super Contributor
timestamp: February 03, 2021, 08:15:41 pm
content: Quote from: wraper on February 03, 2021, 07:37:27 pmHis point was to not have JLCPCB install the chip. Though, why use TH at all. Clearly he knows how to solder SMDs. Just drop the part from the BOM.On a related note, I've found LCSC (JLCPCBs disti) to be oddly spotty with Atmel chips. They don't seem to carry any of the more recent ATTiny chips (1 series, for example) and their prices are often higher than western distis like Mouser and Digikey. I wonder if they are getting their supplies through a 3rd party which makes counterfeits a distinct possibility.

author: sleemanj
author_rank: Super Contributor
timestamp: February 03, 2021, 10:28:48 pm
content: Hmm. Reset issue would be my first guess. Do you have an external pullup for reset or are you relying on the internal one?

author: Peabody
author_rank: Super Contributor
timestamp: February 03, 2021, 11:34:12 pm
content: I can't see all the markings clearly. Do all the JLCPCB Atmegas have identical markings?AtmelMEGA328PU-TH35473D2025TYTAnd what about the Mouser chips? How are they marked?Is there any chance this is a bootloader thing?

author: lutkeveld
author_rank: Regular Contributor
timestamp: February 04, 2021, 07:04:05 am
content: Have you burned the exact same bootloader on both?

author: JLCPCB Official
author_rank: Regular Contributor
timestamp: February 04, 2021, 07:48:32 am
content: When customers have questions about the quality of JLCPCB's products, we need to clearly state:First of all, our service can operate at a very low gross profit margin and provide users with more favorable prices. The main reason is the efficiency improvement brought by advanced technology and equipment. But this does not mean that we will provide inferior source materials. A large number of users choose JLCPCB, and it has been extolling its good reputation for 15 years because of its reliable quality.LCSC is China's largest component mall, with 400,000 kinds of components in stock. lcsc knows that any component problem will broke the entire electronic project or systems, and the component supply control is extremely strict to ensure the reliable quality of the supply of components.Usually, the staff will respond quickly to complaints with suspected quality, usually within 24 hours. We keep smooth communication and reduce communication barriers and misunderstandings.For the SMT project of JLCPCB, the component library of mouser and digikey will be supported in the future, and it is expected to be realized in 2021. Those who trust JLCPCB's services please also trust the quality of our products' raw materials and components. Thanks for all the attention

author: Psi
author_rank: Super Contributor
timestamp: February 04, 2021, 08:18:38 am
content: I've had counterfeit parts from PCBway, it can happen from all of the cheaper hobbits PCB companies.Unless you make it clear on the BOM where each part can be purchased from you will get bad parts from time to time.Once I started giving directions on the BOM for authorized sellers the problem stopped occurring.The other option is to use a more professional PCB company, but they usually won't do small orders.They do have much better QC though.

author: sleemanj
author_rank: Super Contributor
timestamp: February 04, 2021, 08:56:34 am
content: Counterfeit is possible of course, but, I wouldn't jump to that conclusion.The counterfeits (the first and only known to date) discovered last year were only found because somebody noticed that the sleep current was higher than expected, otherwise they (in so far as anybody has seen) operated normally.It would be an interesting counterfeit that worked well enough to accept and read back flash, but failed at sucha fundamental thing as toggling a GPIO.Certainly some more investigation would be interesting. As above, I'd be looking at RESET. If RESET isn't being pulled high externally (or weakly), just relying on the internal pullup (which maybe if is counterfeit isn't there), then it could well (SPI) program and readback ok, but do nothing otherwise.

author: gnuarm
author_rank: Super Contributor
timestamp: February 04, 2021, 09:17:56 am
content: I would be very interested in hearing how this is resolved. blackstealth, please get back to us if you hear from JLC.Looks like someone from JLC replied to this thread, but they posted an image of a support reply to someone, but it is not clear if that was blackstealth's query about the problem or not.

author: Psi
author_rank: Super Contributor
timestamp: February 04, 2021, 11:04:48 am
content: One possibility is they are recycled chips and did not get fully reset to default state when they were erased, fuse bits etc..Fuse bits is the fist thing I would check between working and non-working AVRs

author: TheHolyHorse
author_rank: Regular Contributor
timestamp: February 04, 2021, 01:26:51 pm
content: Quote from: Psi on February 04, 2021, 11:04:48 amIt would be bad if they were recycled and not mentioning it when selling them.

author: wraper
author_rank: Unknown
timestamp: February 04, 2021, 01:37:35 pm
content: Package and marking look legit to me. If they were recycled, they would need to be blacktopped and remarked to have such fresh date code. As op did not bother to check if crystal was actually oscillating and what was on reset pin, and decided to just brute-force the problem by throwing the parts onto it, hard to say what was an issue. Might be a marginal design which did not work with particular batch of MCUs or say conductive-ish flux. I wonder if he bothered to check if VDD was actually 5V which is required for 16MHz operation.Also there are other oscillator related fuses other thanQuoteIt can be configured as ceramic resonator and "full swing crystal oscillator" at the same time.

author: Peabody
author_rank: Super Contributor
timestamp: February 04, 2021, 02:48:23 pm
content: I'm the one who started all the fuss last year. The result of that was that Microchip confirmed that the chips I sent them were counterfeit. In addition, a chip which functioned properly in all respects was also deemed a counterfeit by Microchip. My suspicion is that the Arduino clone market has been rife with counterfeit chips, which worked ok, for years, but I can't prove that.Personally, I don't have a problem with counterfeits so long as they work properly. But if we now have another example of chips which don't work, we need to get to the bottom of it. I'm confused by the picture. The markings appear to be genuine. So is that a picture of the bad chips or the replacements?We need to get blackstealth to run Kevin Darrah's test sketch on the bad chips, and perhaps reflash the fuses and bootloader. Or if he doesn't want to be bothered with it further, Kevin might be willing to test them, or I could privately send blackstealth contact information of a VP at Microchip to whom he could send the chips for evaluation.In any case, if we now have counterfeits with seemingly valid markings, and which have been modified to pass Kevin's test, but which don't work, we need to know that. Last year's examples at least had what turned out to be goofy markings, and none passed Kevin's test. But all of that could have been corrected on the next production run of counterfeits.So hopefully blackstealth will return to this thread shortly, and we can get to the bottom of this.

author: 48X24X48X
author_rank: Frequent Contributor
timestamp: February 04, 2021, 03:03:02 pm
content: I did tested JLC's assembly using 10 pieces of the ATMega328P-AU. And I verified the fuses last time and it seems legit. The sleep current is also spot on. But, I wouldn't rule out any counterfeits IC too on top of the technical issues discussed here.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 08, 2021, 01:36:39 pm
content: The MCU you took from the Arduino board has the fuses and bootloader properly installed. You can only program flash files with the program code in them and they will work.From LCSC, you have received completely clean MCUs. Maybe that's the problem? You can run Mega without a bootloader, but you need to write the fuses correctly.Try to return one MCU to your board, read fuses from the Arduino, and write them to the MCU that you think is faulty.It is not known how you create the program, if in Arduino, then use the option "write bootloader" - it also sets the fuses correctly.

author: Peabody
author_rank: Super Contributor
timestamp: February 08, 2021, 02:57:20 pm
content: I assume the replacement chips he got from Mouser were also completely clean.Well, I hope he will return to the thread with more information.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 08, 2021, 04:59:43 pm
content: Quote from: Peabody on February 08, 2021, 02:57:20 pmThe person wrote two messages and disappeared. Either he is desperate and upset, or it is a lie to the Chinese comrades.There are lies in the world now... We often see this.

author: phil from seattle
author_rank: Super Contributor
timestamp: February 08, 2021, 05:28:09 pm
content: Quote from: S. Petrukhin on February 08, 2021, 04:59:43 pmMany things are possible here though the truth is most likely the simplest explanation. We often see "drive by" posters that never come back. Some percentage are likely disinformaticheks but I think most are not.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 08, 2021, 05:44:58 pm
content: Quote from: phil from seattle on February 08, 2021, 05:28:09 pmI agree! Everything is possible. And the Chinese guys could sit in the trough.But the strange thing is that a person for more than 10 years is engaged in a simple 328p crystal, but the test is performed by replacing the MPU, replacing the oscillator. After all, you could watch the generation on a quartz resonator, you could apply external clocking to check the chip, go through step-by-step debugging on the chip, etc. I don't remember if there is a clock from the internal generator in 328p, which you can switch to to check. There is a JTAG boundary scan present or not.But I would not be in a hurry to make loud statements without finding the reason reliably. I also had situations when the AVR did not take off immediately, most often it was my soldering errors, but I looked for the reason and did not panic.I was happy with the STM32 with a reliable start, without fear of losing the start due to faulty fuses. Now I miss simple AVRs with a good IDE and great Atmel examples/solutions that could be hoped for and used intelligently, understanding what is going on.

author: riyadh144
author_rank: Unknown
timestamp: February 08, 2021, 06:22:55 pm
content: Yeah I don't think we should come to conclusions until we see some real evidence, schematics, layout, microscope shots, scope shots of waveform, and most importantly the code.

author: 1276-2449-1-ND
author_rank: Regular Contributor
timestamp: February 11, 2021, 03:05:49 pm
content: I have the same suspect ATMEGA328P U-TH microcontrollers from LCSC.I had problems programming them too, and it seemed to have to do with clocking. I suspected that these ICs have some sort of weird clock feature/limitation that hasn't made it into the documentation yet (like how the 328PB had people scratching their heads for a while.)Microchip put out a notice that they were relabeling their ICs, and I think that the U-TH has more to do where it was manufactured than what the ICs. There's a discussion about it here:https://www.avrfreaks.net/forum/another-it-fake-chip-thread-atmega328pu-th-tqfn-pkgI don't have time to look into it further, but I can send a few chips to people who want to examine them.

author: Peabody
author_rank: Super Contributor
timestamp: February 11, 2021, 03:35:08 pm
content: Quote from: 1276-2449-1-ND on February 11, 2021, 03:05:49 pmI believe the U is just the package, and TH is a country code (Thailand). TH and PHilippines are typically found on genuine chips. KoRea and TaiWan were on the counterfeits previously found.Did you eventually find a way to program them? If so, could you please run the sketch below and post the results here?Code:#include <avr/boot.h>#define SIGRD 5void setup() {// put your setup code here, to run once:Serial.begin(9600);Serial.println("");Serial.println("boot sig dump");int newLineIndex = 0;for (uint8_t i = 0; i <= 0x1F; i += 1) {Serial.print(boot_signature_byte_get(i), HEX);Serial.print("\t");newLineIndex++;if (newLineIndex == 8) {Serial.println("");newLineIndex = 0;}}Serial.println();}void loop() {}