2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ How are you programming the first? \$\endgroup\$ – Ignacio Vazquez-Abrams May 23 '15 at 20:55
  • \$\begingroup\$ @IgnacioVazquez-Abrams With an RF module. \$\endgroup\$ – Zgrkpnr May 23 '15 at 21:00
  • \$\begingroup\$ Does the module have a GPIO you can control out-of-channel? \$\endgroup\$ – Ignacio Vazquez-Abrams May 23 '15 at 21:04
  • \$\begingroup\$ @IgnacioVazquez-Abrams Yes, but it is almost impossible to soldier a pin on it. There is not any pins soldiered to it. \$\endgroup\$ – Zgrkpnr May 23 '15 at 21:07
1
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ I guess that exceeds my knowledge if I am not missing a point. \$\endgroup\$ – Zgrkpnr May 23 '15 at 21:47
  • \$\begingroup\$ Are you aware of the concept of a bootloader? \$\endgroup\$ – Tom L. May 23 '15 at 21:50
  • \$\begingroup\$ Not enough. I know what is a boot loader, but I don't know how to program one. \$\endgroup\$ – Zgrkpnr May 23 '15 at 21:52
  • 1
    \$\begingroup\$ You might want to read this: electronics.stackexchange.com/questions/112440/…. Don't think of the bootloader as something highly complex and difficult. Basically it's a program of its own which is able to overwrite certain positions in flash. You need some method of changing from your application to the bootloader and back. The easiest way to do this is by using a dedicated pin, but a command sent via UART can be used as well. It's certainly some work, but it can be done. \$\endgroup\$ – Tom L. May 23 '15 at 22:07
  • \$\begingroup\$ I took a look at the topic and it seems reasonable for me. I will give it a try. It look like it is a solution. \$\endgroup\$ – Zgrkpnr May 23 '15 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.