ATmon is a bootloader and monitor tool for Atmel ATmega32 microcontroller. It consists of two parts: bootloader program for the MCU itself written in assembly, and Java application to be run on a PC for monitoring and programming the MCU.
You need:
- BootLoader.hex v1.5 (new: 6/20/2006)
- RXTX library
- ATmon v2.0 (new: 6/20/2006)
- m32def.inc
RXTX is a library for Java providing support for serial port. There is RXTX homepage. Windows users need to:
- copy RXTXcomm.jar from RXTX zip-file root to jre\lib\ext
- copy rxtxSerial.dll from RXTX zip-file windows directory to jre\bin
The jre
directory is the root directory of Java Runtime Environment, and may look like: C:\Program Files\Java\jre1.5.0_06.
Download ATmon to arbitrary directory on your PC. You should be able to run it just by double-clicking it. In case it does not work, set the correct action for JAR extension (Folder options / File Types), or you may use this batch file put into the same directory.
The bootloader has to be written to the MCU using ISP. Run AVRStudio and just open the AVR programmer without loading any project. In the Flash box, select the downloaded Bootloader.hex, and program it. The bootloader communicates using baud-rate of 19200, and it expects the MCU to be running at 8 MHz. On the Fuses tab, select the following options, and program it:
- Boot Flash section size = 1024 words
- Boot reset vector enabled
- Int. RC Osc. 8 MHz
On the Lock Bits tab, select the following option, and program it:
- Boot Loader Protection Mode 2: SPM prohibited in Boot Loader Section
Because the bootloader needs a few bytes of memory for itself, which are located at the end of SRAM, the stack pointer initialization needs to be modified in order to skip the bytes. You can either:
- In your stack initialization (ldi r16, low(RAMEND); out SPL, r16; etc...), replace
RAMEND
withRAMEND-0x20
- Put the downloaded m32def.inc to your project folder. This way, when you use directive .include "m32def.inc", the assembler will include the local include file, instead of the default for the assembler.
If you have any sugestion, have found any bug, or if there is a volunteer for writing a documentation, please, send me an email.