I wrote a sketch and will need to upload it to several hundred Mega 2560's. It's the same sketch going to all of them, so I would like to avoid compiling it each time (it's a relatively large sketch). I thought about uploading using the ICSP header and blowing out the boot-loader, but I would actually prefer to keep the Arduino boot-loader if possible.
It did better than expected leaving me with a lot of chips to program. I decided to go the shield route with the project (instead of a all-in-one proprietary board) so my customers "break the seal" and play with the code if they wanted. I included the source to all of the backers who bought kits or complete units.
Do you have a programmer with a Zero Insertion Force socket? If not, you'll want one. (You can build one on a breadboard.) Once you know the AVRDude syntax, it's as simple as (up arrow) (Enter), wait, swap chips, (up arrow) (Enter), wait, swap chips ...
Or you can buy them from the parts house pre-programmed. Not sure what the minimum quantity is for that, but it might be worth the time to ask.
not sure, but do they make a chip clip that could be used?
I assume that you mean surface mounted chips are pretty hard to remove, insert into a ZIF socket, program, then put back on the board. yeah, there is probably an easier way.
Chip clip is not needed.
There is discussed frequently here how to download a bootloader and sketch at the same time via ICSP. Answer seems to be to combine the two .hex files (manually) and then load it using Burn Bootloader type command, but using the new combined file.
That may or may not be totally correct - but if so, a tool like this can be used to program the file also - plug on the ICPS connector, press the button, wait for the green LED to stop flashing, done.
No PC needed, can give it to anyone to load the boards for you.
Or you can make a standalone-avr-chip-programmer using you arduino Mega. All you need to is wire VCC, Gnd, MISO, MOSI, SCK, RST and XTAL1 (if you need external clocking).
CrossRoads:
So Arduino offers pre-programmimg of Mega boards now? That's a new one to me.
I've done a lot of business in the past. Buy enough of anything and you can usually come to arrangements.
This comes from being at both ends of the stick.
I already have the Mega 2560's on hand and will be responsible for the programming. I want to ensure the Arduino boot loader remains intact because I am giving them to my customers who, if they want, may tweak the code, but may not have the ability to restore the boot loader.
I will try to combine the hex files and see how that works out. I'll be sure to post what my final procedure is in case anyone else cares or has the same situation.
If you have Arduino MEGA2560 boards, don't they already have bootloaders and USB cables?
You could actually connect multiple boards to a PC at once with a different IDE window for each.
I've done that but you'd still have to go into Tools to set the port on each and then hit the upload button. However you would be setting the next window for the next board while the previous in uploading and not be idle for that time. The hard part is to keep straight which board goes to which window and not load one twice and miss another for however long it takes to do many. Strategies for that would include putting the boards in numbered and/or colored areas to tell them apart easily, people features. With every extra PC/laptop/hub you could shorten the total time.
If your sketch has BWD with non-standard frequency (standard is 1 sec on, 1 sec off) built in then led 13 can tell you if a board has been loaded and serves as a program operating status light. It'd be harder to miss one then.
GoForSmoke:
If you have Arduino MEGA2560 boards, don't they already have bootloaders and USB cables?
You could actually connect multiple boards to a PC at once with a different IDE window for each.
I've done that but you'd still have to go into Tools to set the port on each and then hit the upload button. However you would be setting the next window for the next board while the previous in uploading and not be idle for that time. The hard part is to keep straight which board goes to which window and not load one twice and miss another for however long it takes to do many. Strategies for that would include putting the boards in numbered and/or colored areas to tell them apart easily, people features. With every extra PC/laptop/hub you could shorten the total time.
If your sketch has BWD with non-standard frequency (standard is 1 sec on, 1 sec off) built in then led 13 can tell you if a board has been loaded and serves as a program operating status light. It'd be harder to miss one then.
This is what I want to avoid. Yes I could do that, but each time I go to upload to a board, it will have to compile the source first (this will be quite time consuming). I also don't want to have 250+ virtual com ports configured on my PC.