Go Down

Topic: Flashing multiple ATmega328p chips over ISP connected to an ATmega32u4 (Read 528 times) previous topic - next topic

devingator

Hello,

I currently have been working on developing a motor controller board with a main ATmega32u4 that handles communication with the computer over Serial then sends data packets to one of the eight atmega328p chips that handle motor control. I have combined the Arduino as ISP script with my own communication script and it is running on the Atmega32u4 and allows me to flash a singular chip based on the reset pin I specified in the script. Is there an efficient way of flashing all eight at once or all eight in sequence with the former being preferable in terms of speed.

Thank you

PaulRB

I guess if you connect the RESET, MOSI, SCK lines of all 8 328s together it might work. But only connect one of the MISO lines back to the 32u4, otherwise there could be data corruption or even damage. This means that only one of the 328s gets its program verified, but if you are confident they are all identical and the connections are reliable, it should work.

If you want to verify they all get programmed correctly, you could connect the MISO lines back to the 32u4 with an 8-way multiplexer (e.g. 74hc4051). Control the multiplexer with 3 unused 32u4 pins. Each 328 would get programmed 8 times over, but it wouldn't take any longer than doing them in turn, and you would be able to verify that each got correctly programmed.

david_2018

If you want to verify they all get programmed correctly, you could connect the MISO lines back to the 32u4 with an 8-way multiplexer (e.g. 74hc4051). Control the multiplexer with 3 unused 32u4 pins. Each 328 would get programmed 8 times over, but it wouldn't take any longer than doing them in turn, and you would be able to verify that each got correctly programmed.
You still wouldn't know if they were all programmed correctly, because the previously verified chips could get a corrupt upload while you are checking a later one.

Using a separate RESET line to each chip should make it possible to program one at a time, and if the code itself can be stored on the 32u4 instead of needing to send it over USB each time the total time needed to program 8 328's will not be very long.


hammy

You could buy your processors already programmed - companies such as microchip.com offer this service.

CrossRoads

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