EEVblog® Electronics Community Forum
Electronics => Microcontrollers => Topic started by: Torrentula on November 25, 2012, 11:27:18 am
-
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
-
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.
-
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
-
Avnet offers a programming service, are there other distributors that do as well?
-
Get a professional programmer for mass production :-) Such beasts program 8 MCUs at the same time and several of those can be stacked.
-
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.
-
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.
-
If you want to control a group of programmers via batch files, here is an interesting read from sparkfun
http://www.sparkfun.com/tutorials/233 (http://www.sparkfun.com/tutorials/233)
-
Is there a easy way to add unique serial number to the flash or eeprom? So that it counts up every next chip programmed.
Some programming software support this as a built-in feature, eg. the software for Asix's universal serial programmers (http://tools.asix.net/index.htm).
-
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.
That'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.
-
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 :)
-
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.
-
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.. :)
-
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.
-
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.
Or 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.
-
Problem with bootloader is that you have to program every chip twice -- first the bootloader and then the firmware.
No 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.