Electronic – arduino – How to program a microcontroller over another microcontroller

arduinoatmegaavrmicrocontroller

I am currently working on a project that requires two separate microcontroller to work together, but since I am still working on the project I generally need to update their programs.

I couldn't find a solution to my problem and that's why I am programming the second microcontroller unplugging UART connections and connecting it to USB to TTL adapter. After programming make those connections again with other microcontroller.

As you see it is long even when I am describing.

I am using two AVRs. (Atmega32 and Atmega328p). Is there a way to program 328p with 32?

NOTE: In operational configuration they are communication via serial communication. I want to program one with another without changing this configuration.

Best Answer

Basically your task will be to program a bootloader onto the one at the very end. That bootloader will need to accept specific commands via UART which causes it to reboot (watchdog?) and then enter the bootloader section. From the bootloader, it will again accept data which will overwrite your application area. After the update is done, boot to your application section (until you receive the command to update again).

Are you planning for a redesign at this point?