Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

Many AVRs have the capability to be ISP'd - or in system programmed over SPI. I have a project where the entire device can get firmware updates, and I'd like to also update the firmware on it's front panel from the main micro. Since the front panel is conveniently connected through SPI, I've had the idea of just re-programming it from my main MCU over SPI.

That's the ISP method, which would be quite easy and would not require me to write a boot loader. If I can't do the ISP, then of course I will be needing a bootloader.

So basically - can another MCU re-program the ATMEGA644 over the SPI bus?

share|improve this question

1 Answer

up vote 5 down vote accepted

Yes, very easily. In this scenario, RESET works as the active-low slave-select. The programming algorithm is very well documented in every AVR datasheet (look under Memory programming, Serial Downloading).

Note however that some AVR chips have their ICSP SPIs on different pins than their regular SPIs (for example, atmega128 shares the ICSP SPI with one of its USARTs).

share|improve this answer
Thanks for the answer - Once I get off my lazy butt and design myself a PCB, I'll try this out and try to write some code to do exactly this. Is there any other little gotchas to take care of when doing this, like you needing to use 12 V to program like you do on some other MCUs? – Tristan Seifert Oct 7 '11 at 4:52
@TristanSeifert, no gotchas, it's pretty much straightforward. Take a look at technika.junior.cz/trac/browser/shupito/shupito/fw_common/… if you want some inspiration. :) Goot luck! – avakar Oct 7 '11 at 5:11

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.