Uploading to multiple boards

Hi All,

I wonder if anyone has an alternative idea.

I'm looking for a EASY way to upload the same program to multiple boards, namely approx 50 of Pro Mini to start with.
Sorry for capitals but emphasis on 'easy' is the key here as the updates needs to be handled by kids, not by me. So, easy is a must.

This is what I've got so far.

I builded a prototype of an upload rig which can handle up to 40 parallel devices. It is connected to NANO which has exactly the same atmega328p processor and USB. Connection between NANO and any (all) Pro Mini in the rig is:

NANO PRO MINI
5v VCC
GND GND
RST DTR
TX TX (through 1K resistor)
RX RX

The resistor on TX is important as the whole passing upload via NANO to Pro Mini doesn't work without it.

Then I plugged in 10 Pro Minis and run about 100 tests with sketches of various sizes, always ending up with 100% success. Not even once any of the Pro Minis failed to receive new sketch. You can watch the upload video here:
uploading to 10 Pro Minis - first upload at 2sec (they will blink all together), second upload at 20sec (they will blink 'at will').

This seams to work unexpectedly well and yet I keep reading that is shouldn't. Would anyone have any experience with similar setup failing? If yes, what kind of pitfalls can I expect?

Any input much appreciated.

Cheers.

This seams to work unexpectedly well and yet I keep reading that is shouldn't. Would anyone have any experience with similar setup failing? If yes, what kind of pitfalls can I expect?

++Karma; // I love it when someone makes something work when other have said it shouldn't! If it works and you are happy with it why look for problems?

My only concern with what you have is there might be power problems, I'd have a separate 5V PSU for the boards you are programming and I'd go mad with 0μ1 capacitors at each connector.

Well done, I have no comments other than that.

PerryBebbington:
++Karma; // I love it when someone makes something work when other have said it shouldn't! If it works and you are happy with it why look for problems?

My only concern with what you have is there might be power problems, I'd have a separate 5V PSU for the boards you are programming and I'd go mad with 0μ1 capacitors at each connector.

Well done, I have no comments other than that.

Why look for problems? Because there is always something and never nothing :smiley: :smiley: :smiley: I have way to many winters to be more optimistic than that, hehe.
As for power problems - you are absolutely right. Even this prototype can't take much more than 10 pro minis pulling from 5v pin. Once I go with all 40, I'm planning to power this upload rig with external power supply and have GNDs connected. This should do. As for capacitors - I'll give it a try why not, that's why they are cheap right? :smiley:

Cheers.

For 40 you might want to buffer the TX, maybe asking it to drive 40 is asking too much, don't know, just thinking out loud. You will find out when you try it!

So are you flashing firmware via serial port? The photos aren't clear to show what pins were used. I'm just guessing with my own nano that you're using serial download. It's a process that requires two way communication between the programmer and the target. By connecting all pros' TX together it's a really bad idea. Working or not, you're damaging them. The protocol, the details of which I once knew, is not designed to broadcast firmware to multiple target boards. What you could do, is to only have one pro's TX connected to the RX or your programmer and ignore the TX of the rest, which should all be disconnected from one another. This way there's no contention on programmer's RX logic. You get confirmation from only one pro but how often do you get errors with program download to your nano? I don't remember.

benderooo:
I wonder if anyone has an alternative idea.

There are numerous examples of uploading a sketch using an arduino as an ISP programmer, with the sketch either stored on an SD card or (if small enough) on the arduino used as the programmer. Make a fixture with pogo pins that the target board can be held down on, and the programming can be done fairly fast and without the need for a computer. Note that this type of programming does wipe the bootloader, so the .hex file being programmed onto the board needs to include the bootloader along with the sketch.

Adafruit Standalone Arduino AVR ISP Programmer

Atmega chip stand-alone programmer to upload .hex files (in particular the section on "Variant which uploads a single file" )

liuzengqiang:
So are you flashing firmware via serial port? The photos aren't clear to show what pins were used.

There is a table in my post describing all connections.

By connecting all pros' TX together it's a really bad idea. Working or not, you're damaging them.

How exactly they can get damage? Would you be so kind to expand this statement?

You get confirmation from only one pro but how often do you get errors with program download to your nano?

I never got any error with this setup.

What you could do, is to only have one pro's TX connected to the RX or your programmer and ignore the TX of the rest

This is not the setup here. I am connecting all Arduinos in parallel, not TX to RX.

david_2018:
There are numerous examples of uploading a sketch using an arduino as an ISP programmer, with the sketch either stored on an SD card or (if small enough) on the arduino used as the programmer. Make a fixture with pogo pins that the target board can be held down on, and the programming can be done fairly fast and without the need for a computer. Note that this type of programming does wipe the bootloader, so the .hex file being programmed onto the board needs to include the bootloader along with the sketch.

Yes, I did seen this method and I'm still exploring it for later use of programming multiple boards from the tablet device, not computer. Ideally via ESP bluetooth.
However this post doesn't go this far. For now I'm just trying to cement a way to program multiple boards in parallel so the process can be as quick and user friendly as possible. Asking anyone to repeat exactly the same process over and over again, just because she/he has for instance 20 pieces of the same product is just not good UX. What if it is not 20 but 200? It quickly goes out of the hands this way. AND btw, this is exactly what Arduino IDE is asking me of :wink:

Good on you for trying this for your kids.

At worst it will damage the boards, at best it may be unreliable. (At least it's not a bunch of LiPo batteries being charged in parallel). This is a digital signal, not a battery powering a bunch of Christmas lights. Same reason that you can't solder an HDMI splitter 5 ways to connect 5 displays showing the same thing.

FrancisH:
Good on you for trying this for your kids.

At worst it will damage the boards, at best it may be unreliable. (At least it's not a bunch of LiPo batteries being charged in parallel). This is a digital signal, not a battery powering a bunch of Christmas lights. Same reason that you can't solder an HDMI splitter 5 ways to connect 5 displays showing the same thing.

Thanks for input. So, how is it that so far it works 100%?
The 'unreliable' part is exactly what confuses me here because either I have 10 magical Pro Minis which happens to work with this setup and no other ever will, or there is something right about this setup. And to be clear - those Pro Minis I have are cheap clones so I'm definitely not expecting anything magical of them.

The truth is, for your application, if it works for you, keep at it. If it fries something, nothing lost. It's not like it's controlling a medical device or a braking system:)

I've had a lot of prototypes that work fine at first, and then either the performance decreases or it just quits working altogether which is really frustrating.

If the TX line of one ProMini goes low and another one goes/is high, you have a short that can damage the pin on one or both ProMinis.

Timing differences can cause this.

That is why it's a bad idea on general.

One way to protect your devices is by connecting all TX lines via resistors.

Note:
If one ProMini is faulty and does not adhere to the upload protocol, the upload of all of them will more than likely fail.

Only I can say that you have done very well your working progress is really productive and nice you should keep continue doing this. But you should pay little more attention while connecting two main power supply psu.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.