AVR Project
Bootloader() & SimpleMain()
 

 

Home Projects AVR Projects Tools Robotics
Various embedded projects (and ideas) I'm working on ...

 

Description This is a bootloader for the AVR ATMega series
(initially made for the 64K, later updated for 128K) but it should be suitable for most of the ATMega's.

A bootloader is a piece of code, firmware placed on a system making it possible to load and start up. Since it's an embedded platform, the term "bootloader" means a piece of code making it possible to start a pre-defined piece of code - that again later starts the platform applications.

A flash-programmer [re-flashing, reprogrammable, reconfigurable etc] replace the existing code during special conditions (bootmode). This makes it possible (in our case here) to make the platform programme it-self.

We here have a Bootloader (containing re-flash capabilities), that could replace any existing application, with a new application.

 

 

Notes This bootloader is made in a rush, over a couple of long nights during a 2 week period. So no much optimization and rework has been added after it was working. Initialle it worked fine with the 64K version, but since I only had 128K version, I ran into lots of problems regarding the programming and selection (in the makefile).

Further more are a lot of debugging stuff left in the code, this should be removed.

 

Detailed
References, links etc The ultimate best site for AVR-Freaks is http://www.avrfreaks.net

Wiki --> http://en.wikipedia.org/wiki/Booting

BOOTLOADER <bootloader & application picture - coming soon>

Bootloader is a small 'resident' program making it possible to switch out the real application code, again and again, and again ... without having any programming tools available (JTAG or ICE).

Standard ATMEL 50-100$ development platform (Specification here)

bootloader --> STK-500    (select by compile time-config in the file here below)
bootloader --> MAVRIC-IIb  (select by compile time-config in the file here below)

Boot up program flow:

 

Functions/modules in the bootloader.c (and a couple other) file:

 

How to compile the stuff, install it and how to run it .... read more here, 

 Requires: JTAGICE for installing bootloader. HyperTerm for uploading application to the board.

En bootloader er et lille permanent program der kan loade/skifte den applikation ud som er loadet på CPU'en. Dette uden at man skal have specielle tools som f.eks en JTAGICE ...

En standard udviklings platform med 8 LED og 8 knapper.... (specifikation her)

Hvorledes det kompileres, installeres og hvorledes der loades ny applikation - læs mere her..

Krav: JTAGICE kræves for at isntallerer bootloader. Hyperterm for at uploade nyt program til board'et.

 

Application / Program  
A simple and small program that demonstrates a simple application - flashing a LED, reading a key press an stuff like that ...
En lille bitte program der demonstrerer hvorledes en LED blinker, en knap læses m.m ...
Download area  
  Short description Download link
Download a simple test progam for AVR This is a bootloader program, which (if loaded) makes it possible to upload/change the application code using serial interface (aka a PC) download source.zip 
Download bootloader This is a small and simple test application for STK500 or MAVRIC-IIb boards ... download source.zip
Download bootloader & SimpleMain This is a small and simple test application for STK500 or MAVRIC-IIb boards AND the Bootloader in a single .zip file... source.zip
Bootloader document PDF file with little documentation and further descriptions on usage, implementations etc document(0.03)
 
Howto's  

Bootloader: 

  1. Select your platform, 
  2. select your CPU, 
  3. select your 'enable-bootloader-pin-level' (named BOOTLOADER_PINLEVEL), 
  4. select your 'bootloader-port' (named BOOTLOADER_PORT), 
  5. select your 'bootloader-pin' (named BOOTLOADER_PIN), 
  6. compile the stuff.
  7. Flash it using JTAG.

 

Simplemain: 

  1. Select your platform,
  2. Select your CPU,
  3. Select you RED_LED, GREEN_LED, KEY_PIN etc
  4. compile the stuff
  5.  

You could easily adapt several 'almost' equal applications files, just for verifying the functionality.

 

PC:

  1. Start-up your Hyperterm program , select XModem protocol.
  2. Initiate a upload using 'upload' menu - send the application file
  3. Reset the HW (make sure the bootloader enable pin is activated)
  4. transfering should start autoamtically

 

 

General Requirements
  • WINAVR.
  • AStudio.
  • JTAGICE or other program to use for putting the bootloader onto the CPU.
  • STK-500 - or equivalent.
  • HyperTerm (running the setup'd baudrate and X-Modem) for putting the application on the CPU.

 

Additional Notes ATMega128 Bootloader is used in my robot :-).
And I have had it running on various systems implementations, and the SDK500 and MAVRIC-IIB.