Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
nleahcim
PostPosted: Jan 05, 2007 - 05:34 AM
Raving lunatic


Joined: Feb 19, 2003
Posts: 2233
Location: Seattle, WA

Hi - I have a 6 legged robot that has an ATMEGA168 on each leg. They talk to each other using MCP2515 CAN controller chips. They are also connected to a central ARM chip (an AT91SAM7X256) via the same CAN bus. I get really tired of reprogramming the firmware of each part - so I'm thinking it'd be really nice to be able to just load the code into the memory card on the ARM and have it send the code to the 6 AVRs. How difficult would this be? Reading in the data from the memory card and sending it over CAN would be easy enough - but I'm not sure about the bootloader. How does one make a bootloader? Can I still use things like interrupts in my code?

Thanks!
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
MegaUSBFreak
PostPosted: Jan 05, 2007 - 09:58 AM
Raving lunatic


Joined: Aug 21, 2004
Posts: 2226
Location: germany

Quote:
How does one make a bootloader? Can I still use things like interrupts in my code?


* There is a section called "self programming" in every AVR´s datasheet.
* There are a lot of threads here in the forum
* There is an ATMEL AppNote (AVR109 if i remember right)

The bootloader should NOT influence your application. You can uses any periferal like desired..

Hints:
* you should be able to start the bootloader with an instruction via CAN
* The bootloader should check if there is a valid application programmed. If not, it should stay in an infinite loop in the bootloader
* Keep a hardware feature to start the bootloder (independent of application, in case that the application fails. Maybe if a pushbutton is pressed after powerUp)

_________________
Klaus
********************************
Look at: www.megausb.de (German)
********************************
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
sutton
PostPosted: Jan 05, 2007 - 11:57 AM
Posting Freak


Joined: Oct 30, 2001
Posts: 1563
Location: Manchester England

Suggest you build a CRC check into the code. On powerup let the main CPU request the CRC from the leg units. If different from the code you have stored local to the main CPU start update as assume new code.

_________________
Keep it simple it will not bite as hard
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits