Microcontroller mass programming - Page 1
Forum section: electronics / general

author: Torrentula
author_rank: Regular Contributor
timestamp: November 25, 2012, 11:27:18 am
content: Hello again!Currently I'm working on a little project where I have to program multiple microcontrollers with the same firmware but different calibration values stored in the EEPROM.In my case the problem should be easy to solve as this isn't going to be a mass manufactured product.When I thought about this I started wondering how microcontrollers are programmed in a mass production environment, especially when they have to program the firmware first and then the calibration values later on?Just asking out of curiousity.Cheers,Elia

author: Psi
author_rank: Super Contributor
timestamp: November 25, 2012, 11:44:29 am
content: My guess would be that the chips are ordered pre-programmed with firmware from the manufacture.Then the eeprom cal data is uploaded during the in-circuit test/bed-of-nails after PCB assembly.The testing rig probably has the gear needed to generate the reference signals required so the cal data can be calculated and programmed automatically.Of course it would depend just how complicated the calibration process is, i imagine some expensive/low volume stuff is calibrated by hand.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 25, 2012, 12:23:35 pm
content: Depends on the Micro - e.g. Microchip have a very cheap service for ordering ready-programmed parts.You deal with the cal data by writing it via your firmware and whatever interface you have available on board.Another approch is to program and cal on-board in a test jig, although this can be a production bottleneck - preprogrammed parts are preferred where possible

author: andersm
author_rank: Super Contributor
timestamp: November 25, 2012, 12:56:40 pm
content: Avnet offers a programming service, are there other distributors that do as well?

author: madires
author_rank: Super Contributor
timestamp: November 25, 2012, 01:29:23 pm
content: Get a professional programmer for mass production :-) Such beasts program 8 MCUs at the same time and several of those can be stacked.

author: ptricks
author_rank: Frequent Contributor
timestamp: November 26, 2012, 09:28:23 pm
content: I have seen 16 slot programmers before used in factories and lots of chips are easily programmed on the board using test pins.For things like calibration data on chips like the PIC it is possible for the firmware to change parts of the code that are stored in the flash. If you know the location in flash where the calibration data is located you can change that data and have it run using the new data on reset. This isn't like changing eeprom data, this is changed in the flash of the code that actually runs. So a variable that might be written as x=32, could be changed to be x=24 by modifying the hex value stored in the firmware. Eeprom would be easier to manage but there are lots of chips in use that don't have eeprom, just flash. Microchip refers to it as self modifying code.

author: Teemo
author_rank: Regular Contributor
timestamp: December 28, 2012, 08:25:39 am
content: Hello!Is there a easy way to add unique serial number to the flash or eeprom? So that it counts up every next chip programmed. For example in PIC.

author: notsob
author_rank: Frequent Contributor
timestamp: December 28, 2012, 08:51:59 am
content: If you want to control a group of programmers via batch files, here is an interesting read from sparkfunhttp://www.sparkfun.com/tutorials/233

author: andersm
author_rank: Super Contributor
timestamp: December 28, 2012, 01:56:14 pm
content: Quote from: Teemo on December 28, 2012, 08:25:39 amSome programming software support this as a built-in feature, eg. the software forAsix's universal serial programmers.

author: lewis
author_rank: Frequent Contributor
timestamp: December 29, 2012, 01:20:18 pm
content: Quote from: Psi on November 25, 2012, 11:44:29 amThat's exactly how I do it. I'll get a load of pre-programmed chips from Microchip without cal values; but I always program in test/cal routines in the firmware to make final test easier. I send the micro some cal values and the firmware writes those values to the micro's flash or eeprom.It's the only way to do it - often the cal values are based on component tolerances of the physical components on-board (including the micro's ADC) so you need to calibrate in-circuit. If I'm making, say, a voltmeter using the micro's on-board ADC, I'll make a test jig that feeds the board sequentially with known, very accurate, voltages. I'll then tell the micro what the voltage should be and the test firmware itself can then correct for offsets and component tolerances storing the cal values as it goes. The whole process can take less than a second if done automatically.

author: RoelA
author_rank: Contributor
timestamp: December 29, 2012, 08:00:03 pm
content: You also could put a bootloader into the chi. Makes flashing new software a lot easier, just a serial port and very simple softeware. No 'higher' voltage needed for programming.For unique serials you could add a onewire Eeprom. These have an unique id that you could use for your program. And, as an added bonus, use for storage

author: Teemo
author_rank: Regular Contributor
timestamp: December 30, 2012, 11:43:03 am
content: Problem with bootloader is that you have to program every chip twice -- first the bootloader and then the firmware.I guess for unique serial number, it can be programmed in throuhg serial port. Just like the bootloader, but loads only serial nr.

author: RoelA
author_rank: Contributor
timestamp: December 30, 2012, 12:01:19 pm
content: Teemo, I know. It was more of a last resort..Like having 10.000 programmed chips from Microchip in stock and finding out that you made an error in your program...Probably easier and cheaper to flash with a serialport and a bootloader than having a stack of programmers..

author: Teemo
author_rank: Regular Contributor
timestamp: December 30, 2012, 08:31:36 pm
content: RoelA, I did not mean the bootloader idea is bad. It is certainly a good option. It is easier and faster to make jig with several serial ports for programming, than it is to make full programmers jig. Specially when there is some individual calibration value or serial nr for every chip.

author: nctnico
author_rank: Super Contributor
timestamp: January 02, 2013, 12:13:10 am
content: Quote from: Teemo on December 30, 2012, 11:43:03 amOr choose a microcontroller which has a bootloader and a unique serial number. The NXP Cortex Mx controllers come to mind. Programming through a serial port is easy and low cost.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: January 02, 2013, 12:43:03 am
content: Quote from: Teemo on December 30, 2012, 11:43:03 amNo you don't.You program a combined image containing both the bootloader and the main firmware, so you have the update facility there if you need it, but it doesn't slow anything down if not.