Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

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.

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

1 Answer 1

up vote 1 down vote accepted

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?

share|improve this answer
    
I guess that exceeds my knowledge if I am not missing a point. –  Zgrkpnr May 23 at 21:47
    
Are you aware of the concept of a bootloader? –  Tom L. May 23 at 21:50
    
Not enough. I know what is a boot loader, but I don't know how to program one. –  Zgrkpnr May 23 at 21:52
1  
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. –  Tom L. May 23 at 22:07
    
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. –  Zgrkpnr May 23 at 22:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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