Go Down

Topic: Programming multiple ATMega's/arduino's at once (Read 7080 times) previous topic - next topic

omniaxis

Has anyone figured out a way of programming multiple arduino's at once. I'm designing a new product and using the arduino to control it. However, I need to be able to reprogram them (at least 30 at a time) at once. Any advise is greatly appreciated.

Erdin

#1
May 15, 2013, 10:45 am Last Edit: May 15, 2013, 10:47 am by Erdin Reason: 1
When uploading a sketch or using a programmer (for sketch or bootloader), the software does not just write the code, it actually communicates with the microcontroller.

You can't program them all at once. But you can program them one by one in some automatic way.

There are a number of possibilities, but that depends on what you want to do.

  • If you want to update the sketch, you have to connect every Arduino board. Wether you connect all of them or one by one, that is the same amount of labor.

  • If you only want to change settings, you could use the EEPROM.

  • If the project involves all the Arduinos, you could connect them all together in a chain, and let them program each other. This is possible in theory, but perhaps no one has done this yet.

  • It should be possible to connect all of them to a pc, and write a script that uses avrdude and a hex file to upload the new sketches to all of them.


fungus

#2
May 15, 2013, 10:54 am Last Edit: May 15, 2013, 10:55 am by fungus Reason: 1

Has anyone figured out a way of programming multiple arduino's at once. I'm designing a new product and using the arduino to control it. However, I need to be able to reprogram them (at least 30 at a time) at once. Any advise is greatly appreciated.


Program upload is a two way conversation, you can't have more then one chip talking at any given time on a single cable.

You need a PC with 30 serial ports and some clever uploading software

Advanced Arduino

hiduino

If you build your own standalone programmer you could setup all of their ICSP pins in a parallel bus except the reset lines.  Each reset line will need to remain separate, then using some kind of multiplexer selector, you would select one reset at a time to program that unit.  You could use an Arduino running a modified version of Nick Gammon's hex uploader (http://www.gammon.com.au/forum/?id=11638) that could run through and automatically select each unit one at a time (using the selector) to program very quickly.


CrossRoads

I created a sketch and loaded it into one of these
http://www.kanda.com/products/kanda/HH0110.html
Not simultaneus, but takes < 30 seconds to set fuses and download bootloaderless sketch.
Plug it onto ICSP header on a board, press the red button, wait for green light to stop flashing.
Is being used to program control boards in these clocks:
http://www.kiefer.com/kiefer-31--digital-pace-clock---rechargeable-products-1775.php?page_id=160

I like hiduino's idea. Could adapt Nick Gammon's programmer, use it on a mega with 30 unique reset lines, one per board.
Make a breakout board with the ICSP and 30 reset lines in, 30 ICSP output headers for connecting to the boards.
Wouldn't take long to wirewrap up.
Connect them all up, press the button, watch them go.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

actually 2 way communication is not necessary to program avr. for the past couple years ive been flashing as many as 16 at a time. it does require a custom pc program. one of the great drawbacks of avrdude is the inability to do mosi only flashing.

hiduino

For one-way programming how can you verify if programming was successful?


CrossRoads

Have you ever seen it not? I've seen first byte mismatch errors, but that's usually a verification problem, and the part has been programmed correctly.
The other error is signature mismatch, plug in the right part and that is taken care of. The usual problem is data speed mismatch between bootloader and IDE, if you've loaded the right bootloader and selected the proper board type, that is taken care of as well.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

ive never found verfication of any practical use whatsoever. does little more than triple flashing time. in fact its turned off in all my avrdude command lines. in my experience if you can read a fuse or signature for a given setup then unlikely to be any issues with writing flash or eeprom. it may be useful to check new programming hardware or software but even then ive found things either work or dont. for those who require peace of mind and time/productivity not so important then maybe does serve a purpose. as usual everyones mileage may vary.

omniaxis

First and foremost thank you everyone for your input and responses. My question is for john1993, for your setup to work would you run all the ardunio RX pins in parallel? Then just run the sketch which would then transmit to all my arduino's? If that is the case and in that configuration do the arduino's not need to TX (transmit) back to the sketch loader that the upload was successful?

I don't really need them to respond that they successfully uploaded only have the upload work to all of them simultaneously. Again any and all input is great appreciated. 

CrossRoads

They can output on their Tx pins, you just ignore it.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

actually i was referring to isp which is easy because no responses at all are required from the chip and they are all simply wired in parallel.  its doable with serial bootload also but data from the chip is needed so not as easy and again requires custom software. but imo if you need to do many chips at once using a bootloader dont make too much sense.

CrossRoads

Having a bootloader end up on the chip with a simple sketch might be the intended result.
If just the final sketch is desired, that's a different result and loading via Reset & SPI pins makes sense.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

yes, thats true. i was thinking of final application like mentioned in op. but like you say the guys who sell large quantities of arduino chips probably dont do one at a time. or maybe they have digikey or other atmel vendor put the bootloader in. not too expensive in quantty.

CrossRoads

Heck, you buy enough from me, I'll make a programming adapter and will do them for you.
Got a teeanager that can dump parts out of a tube, into a programmer, and back in the tube ...
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up