Česká verze stránky o bootloaderu
Content: Introduction - Features -
How to use it - Download
The basic problem is, that we need to get somehow the bootloader into ATmega8 first. For that, we need some other
programmer. As I did not have biprog yet, I used TSP-IC. As IC-prog does not support newer AVR processors,
I had to use PonyProg. To use PonyProg, I made an adapter.
|
Bootloader is used ideally in those applications, which are naturally connected to PC via serial port. An example of such is
biprog. I will use it as an example for the description, but it is similar for the other applications, too.
Here, I shall remark, that biprog is not the best example application for bootloader presentation anyway. It is a peculiar
application, being a programmer itself, and there are several LEDs to indicate its states while running, and also for possible
reuse for other applications. One of the LEDs (LED6) is dedicated for the bootloader. In "normal" applications, it is enough
to have a single LED, as described for the basic version of bootloader (BootloaderDL5NEG.asm). Biprog uses a different,
modified version of the bootloader - you can find it in the Download section.
Back to the bootloader description. Let's assume that we need to change the firmware of an application. The stk500.ebn
file cannot be used for the ATmega8-based HW, of course. I will not go into details with how to write or modify
an application firmware, but will assume that we already have a new version of the fimware in file "new_version.hex".
Now we have two options, how to "burn" the new fimware into the microcontroller, using the bootloader.
After each reset, the microcontroller jumps to the beginning of the bootloader. A short routine there checks, whether
a button on input TestPort/TestBit is pressed (in case of biprog this is pin PC0). If the button is pressed, the bootloader
will go active. Otherwise, the program jumps to address 0, i.e. the beginning of the "firmware" - in this case
the microcontroller behaves as if no bootloader is present.
So, let's assume, that the button is pressed during reset. In this case, LED1 and LED4 start to flash and biprog will wait
for several seconds for AVRprog to be run. If run in time, LED4 and LED6 will be lit permanently, and the upgrade
can be made in exactly the same way as in case a).
If you are interested, download file BootloaderDL5NEG.asm .
Click the right mouse button and choose "Save target as ...".
99% of the file originates from Herbert Dingfelder, DL5NEG. The modified places are marked by the following comment:
;LR****************************.
Bootloader assembled with parameters set for biprog is in file BootloaderDL5NEG-biprog.hex.
Modified sources for biprog are in file
BootloaderDL5NEG-biprog.asm.
Again use the right mouse button and choose "Save target as ...".
Translated by wek at efton dot sk