4
\$\begingroup\$

I've recently upgraded my old project that goes to mass production (a pair of thousand pieces, pretty niche). Previously I used DIP atmega328p, which were manually programmed in China. I sent them a detailed instruction, HEX of Flash and HEX of EEPROM, all was OK, I made the process as quick as I could, given limits.

But I've decided to switch to SMD version of the MCU (hardware/spacing related reasons). So it will make assembly process quicker and easier. So I thought why not to optimize MCU programming step as well, now that I have a little more experience and knowledge (the original project was one of my very first projects ever). So if I can also get rid of manual programming, it's a double win. I'm aware of zif sockets for qfn-32 which can be used to program the MCUs manually, it's a backup option. I want pick-and-place machine to solder the MCU onto the board and be done with it. Manual programming means manual soldering of the MCU, which, in case of QFN-32, sounds like a really bad idea.

Unfortunately, fierce and fingerbreaking googling didn't yield expected (or desired) results. The best I saw was purchasing Atmegas with a bootloader, which doesn't really solve the problem of course.

So is there a way to buy Atmega328p SMD with Flash and EEPROM programmed? The rest of the PCB will be assembled in China, so if there is any way to do that in China too (LCSC?), that would be great, but I just want to find out if/how this works in general, who could I contact? Should I contact, say, LCSC? Or someone else? It's critical to have BOTH FLASH and EEPROM.

In case it somehow matters: in my project the Atmega328p runs from the internal 8mhz oscillator

\$\endgroup\$
7
  • 5
    \$\begingroup\$ Have you considered in-circuit programming with a test jig? \$\endgroup\$
    – user253751
    Jul 9, 2020 at 13:33
  • \$\begingroup\$ individually programming every chip? Sorry, I have no idea what you're talking about. Please, give a link to a picture or specify somehow. The MCU are intended to be loaded into pick'n'place machine after being programmed. My experience with this is still pertty limited, so a single sentence reply doesn't help much \$\endgroup\$
    – Ilya
    Jul 9, 2020 at 13:35
  • 4
    \$\begingroup\$ In-circuit programming means you solder them to the board and then you program them. Have you considered that option? It is quite popular. \$\endgroup\$
    – user253751
    Jul 9, 2020 at 13:39
  • \$\begingroup\$ I have vertical spacing limits, unfortunately, it's not an option as I see it, although you gave me some idea. I would still prefer chips preprogrammed of course. Thank you for an idea anyway, I'll keep it in mind \$\endgroup\$
    – Ilya
    Jul 9, 2020 at 13:42
  • 5
    \$\begingroup\$ Pogo pins are the usual method of doing this. All you need on the board itself for those is a few circular contacts for the pogo pins to touch, don't even solder anything to them. \$\endgroup\$
    – Hearth
    Jul 9, 2020 at 14:05

4 Answers 4

9
\$\begingroup\$

In my experience, this has only economical for gigantic production runs; the cost of this value-add service can be high (I've been quoted a multiple of the price of each controller.) Consider the cost of the service vs. how much it costs for 30-60 seconds of labour on the production line to program the board and go for what makes the most economic sense.

It's often easy enough to add some circular copper pads on the board and use a pogo-pin fixture to program the micro as part of the board's assembly process. This allows for much more flexibility - imagine what might happen if you need a firmware update and you have 100000 pre-programmed parts in stock. If you don't have programming pins on your board, you'd need to ship'em all back and get them unpackaged/reprogrammed/repackaged. (Also, every time a part is handled there's a risk of ESD or other damage -yields may be affected)

If you really must go with pre-programmed, consider having the supplier only program a bootloader into the controller, and do the programming as part of your product test suite. This still allows you to control and update firmware as needed. Once the bootloader is working, it's rare to ever need to update it so it's much safer to pre-program that part of the software.

At my workplace we produce many controller boards with multiple microcontrollers and we always go with the post-assembly pin-programming option. Any EEPROM programming is taken care of during functional test. The cost of doing it at our CM is much cheaper than pre-programming; also, because we use the microcontrollers in multiple projects we would need a unique P/N for each micro + firmware combination in order for the CM to not get mixed up - that would be a logistical nightmare.

\$\endgroup\$
10
  • 6
    \$\begingroup\$ @Ilya Pogo pins don't go on your circuit board. They go on the other circuit board that you design to program your product with. And they touch tiny copper circles that you put on your product's circuit board. Can you really not think of any way to temporarily plug something into your product's circuit board? How big is it? \$\endgroup\$
    – user253751
    Jul 9, 2020 at 14:24
  • 1
    \$\begingroup\$ something like tag-connect works well - they are pogo pins \$\endgroup\$
    – uglyoldbob
    Jul 9, 2020 at 15:23
  • 1
    \$\begingroup\$ There are a myriad of ways of doing in-circuit programming. None need to be extensively large. Heck, make a few vias larger (and unplated) and use those as your pogo-pin points. \$\endgroup\$ Jul 9, 2020 at 17:54
  • 1
    \$\begingroup\$ ICSP connectors that take up almost no little board space do exist, see e.g. SOICbite. \$\endgroup\$ Jul 10, 2020 at 2:07
  • 1
    \$\begingroup\$ Considering how other answers point out services that can do it for less than 20% of the part cost even at less than 100 units quantities, I do no see how it would be uneconomical. \$\endgroup\$
    – jpa
    Jul 10, 2020 at 7:13
3
\$\begingroup\$

You can order them directly from Microchip pre-programmed and they can ship to your assembly house.

It might be more economical to have the distributor do it, or to incorporate it as part of the testing procedure. Sometimes you might want to load a self-test program and then load the user program when it passes.

Unless your code is extremely simple and stable and your product is disposable, I would strongly suggest retaining some means of reprogramming the MCUs.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ The prices for programming atmega328p by Microchip factory look to be only about 0.30 USD even at low quantities, so this is definitely a good option. \$\endgroup\$
    – jpa
    Jul 10, 2020 at 7:11
2
\$\begingroup\$

Chip preprogramming is a so-called "Value Add" Service offered by many IC distributors. You will receive your programmed chips in a tape, just like you would an unprogrammed SM IC.

Arrow.com has IC programming-as-a-service

Future Electronics has value-add-programming

or, in this case, you can order programmed chips directly from microchip: https://www.microchipdirect.com/programming/price-lookup

Note, when you use a preprogrammed chip and a contract manufacturer (someone assembling your boards), Definitely use your own part number, do not use the normal MFG pn. The CM will tend to just order the "normal" part and skip ordering your special preprogrammed variant.

\$\endgroup\$
2
  • \$\begingroup\$ Does it mean I won't be able to get the chips programmed and compatible with pick'n'place machine? \$\endgroup\$
    – Ilya
    Jul 9, 2020 at 13:44
  • 1
    \$\begingroup\$ They'll arrive in a normal tape/reel configuration for something like the atmega328p. But, if you really wanted them to, they can repackage it however your workflow desires. You'll just pay a fee. \$\endgroup\$
    – pgvoorhees
    Jul 9, 2020 at 13:46
2
\$\begingroup\$

Most projects I've seen avoided pre-programmed chips. One picture is worth a thousand words:

enter image description here

It doesn't have to be a commercial solution like the Tag Connect in the picture, we are using similar in-house connectors. They take very little PCB area (and zero vertical space), and it's possible to make the mating completely automated for high volumes. Guide holes on the PCB are optional: depending on your product it may be easier to align the connector to parts of the case instead.

\$\endgroup\$
1
  • \$\begingroup\$ looks like cool idea. I may build something similar out of stuff around me (I'm good at crafting stuff) \$\endgroup\$
    – Ilya
    Jul 10, 2020 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.