AVR forum - Programming AVR from other micro mattbudd - Mar 17, 2010 - 10:50 PM Post subject: Programming AVR from other micro
I am trying to search about how to do this, but I must be using the wrong terms or something...was hoping someone here could point me in the right direction.
We are going to use an AVR as a slave SPI device to our main micro, and ARM Cortex M-3. Now we would like to support field upgradeability of the AVR through the SPI lines, but all I've read about is actually writing a bootloader on the AVR that talks over SPI and replaces the contents at AVR run-time,
Is there a way we can use the SPI lines to program it just like the hardware programmers (i.e. JTAGICE mkII, or the AVRISP mkII) do...using ISP or PDI? This way we wouldn't have to write a custom bootloader that lives and runs on the AVR, and the ARM Cortex could just fake being a hardware programmer.
Where would I find resources on that?keepcool - Mar 17, 2010 - 10:57 PM Post subject: RE: Programming AVR from other micro
A bootloader is only run ounce every startup if I'm not mistaken, and it doesn't take a lot of of space and is a proven working solution.ka7ehk - Mar 17, 2010 - 11:09 PM Post subject: RE: Programming AVR from other micro
The standard bootloaders use serial port, but any data transport link will work. I would modify an existing loader.
You can, in theory, program it as though your ARM device is a programmer. Check the section "Memory Programming" in your AVR data sheet. It may not be a trivial undertaking but would occupy no additional space in the AVR.
Jimclawson - Mar 17, 2010 - 11:32 PM Post subject: RE: Programming AVR from other micro
Or download the "Buttload" project and you'll see AVR code that will run on one processor to ISP an AVR. While it's written for AVR mega169 it could be ported to the M3. NXP LPC113X (Cortex M3) call SPI "SSP" in fact.angelu - Mar 17, 2010 - 11:37 PM Post subject: RE: Programming AVR from other micro
You need the reset line available as well.