Author Topic: Microcontroller mass programming  (Read 11531 times)

0 Members and 1 Guest are viewing this topic.

Offline TorrentulaTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: de
    • My blog
Microcontroller mass programming
« 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
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10220
  • Country: nz
Re: Microcontroller mass programming
« Reply #1 on: November 25, 2012, 11:44:29 am »
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.
« Last Edit: November 25, 2012, 11:47:13 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13971
  • Country: gb
    • Mike's Electric Stuff
Re: Microcontroller mass programming
« Reply #2 on: November 25, 2012, 12:23:35 pm »
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
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Microcontroller mass programming
« Reply #3 on: November 25, 2012, 12:56:40 pm »
Avnet offers a programming service, are there other distributors that do as well?

Offline madires

  • Super Contributor
  • ***
  • Posts: 8134
  • Country: de
  • A qualified hobbyist ;)
Re: Microcontroller mass programming
« Reply #4 on: November 25, 2012, 01:29:23 pm »
Get a professional programmer for mass production :-) Such beasts program 8 MCUs at the same time and several of those can be stacked.
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: us
Re: Microcontroller mass programming
« Reply #5 on: November 26, 2012, 09:28:23 pm »
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.

 

Offline Teemo

  • Regular Contributor
  • *
  • Posts: 58
  • Country: ee
Re: Microcontroller mass programming
« Reply #6 on: December 28, 2012, 08:25:39 am »
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.
 

Offline notsob

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: au
Re: Microcontroller mass programming
« Reply #7 on: December 28, 2012, 08:51:59 am »
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
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Microcontroller mass programming
« Reply #8 on: December 28, 2012, 01:56:14 pm »
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.

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: Microcontroller mass programming
« Reply #9 on: December 29, 2012, 01:20:18 pm »
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.
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline RoelA

  • Contributor
  • Posts: 10
Re: Microcontroller mass programming
« Reply #10 on: December 29, 2012, 08:00:03 pm »
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 :)
 

Offline Teemo

  • Regular Contributor
  • *
  • Posts: 58
  • Country: ee
Re: Microcontroller mass programming
« Reply #11 on: December 30, 2012, 11:43:03 am »
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.
 

Offline RoelA

  • Contributor
  • Posts: 10
Re: Microcontroller mass programming
« Reply #12 on: December 30, 2012, 12:01:19 pm »
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.. :)
 

Offline Teemo

  • Regular Contributor
  • *
  • Posts: 58
  • Country: ee
Re: Microcontroller mass programming
« Reply #13 on: December 30, 2012, 08:31:36 pm »
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.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27884
  • Country: nl
    • NCT Developments
Re: Microcontroller mass programming
« Reply #14 on: January 02, 2013, 12:13:10 am »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13971
  • Country: gb
    • Mike's Electric Stuff
Re: Microcontroller mass programming
« Reply #15 on: January 02, 2013, 12:43:03 am »
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. 

Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf