Inline graphics on this page: None
AvrMon - an interactive debugging aid
Using avrMon, you can run your work-in-progress at real speed on the real uC in the target hardware, with breakpoints to provide interactive access where needed. Alternatively (or in combination with breakpointed uC software), you can run short sources on the PC, which use the memory, status register and i/o of your target hardware. Automatically commented output looks like this:
---8<--- lsl on_off result 0x02, B00000010 SREG B00000000 sbrs on_off, 5 Bit 5 clear; no skip rjmp next next: com on_off result 0xfd, B11111101 SREG B00010101 and PORTB, on_off result 0x5d, B01011101 SREG B00000001 rcall longDelay longDelay: ldi temp, waitVal result 0x03, B00000011 delay: dec temp result 0x02, B00000010 SREG B00000001 brne delay SREG bit 1 clear; branch taken ---8<---AvrMon: 89 words, which you add to the source you're developing, and a program running on a PC. When active, it needs 7 bytes of stack space. Your target hardware is connected to the PC parallel port using the same cable as your programmer. This may be the cable and `dongle' as supplied with the well-known Kanda STK200, or the one used with SP12. In both cases, the same three uC pins are used: Miso, Mosi and Sck.
A full explanation can be found in the documentation.
NOTE: avrMon is suitable for all AVR uCs except those which have no RAM, like the AT90S1200(A), the Tiny11 and the Tiny12.
AvrMon has long been available for Linux as well as Dos/Windows-3/9X. Matt Blais recently (spring 2004) submitted an XP port of the version for sp12 cables. So there are five possible avrMon(PC) binaries, to be found in the five packages below.
About his XP port, Matt says:
* Only tested under Win XP, but should work the same on Win2K and NT. I have NOT tested it exhaustively. Consider it alpha :) * Uses the GiveIO driver, like SP12. * I had to rename the source files *.CC to *.CPP in order to get MSVC to build them :-( * Added MSVC6 project files: AVRMON_SP12.dsp and AVRMON_SP12.dsw * Added new source files: dos_cpt.h and WinNT.CPP. * Stripped out Curses in the Win32 build because I couldn't get pdcurses to stop trashing the character attributes. I added some replacement functions to WinNT.CPP. * The MSVC 'Release' build configuration optimized away the timing loops, so I removed it - there's only a 'Debug' build configuration in the MSVC project. * Tested only with an AtTiny26 and working fine :-) * Added files: tn26def.inc, AVRMNT26.ASM, AVRMNT26.HEX.In January 2002, Malcolm McQueen wrote about the trouble he had when trying to run and compile avrMon on his modern system. Gcc 2.9 regards some things I got away with in 2.7 as grave errors...
Malcolm not only corrected my mistakes, he also added what you need to use avrMon with the avr-gcc tools. Have a look at the directory /Malcolm in the Linux packages below.AvrMon is available under the GNU General Public Licence. The self-extracting packages and gzipped tar files contain the executable, documentation and source code. AvrMon needed a small correction to run well on recent Linux kernels. And it used to waste rather a lot of cpu cycles, a problem which has also been corrected. Here you have version 0.7 of
AvrMon for Dos/Windows-3/9X and the SP12 cable
AvrMon for Dos/Windows-3/9X and the Kanda STK200 cable/dongle
AvrMon for Windows-XP (and probably Win2000 / NT) and the SP12 cable
AvrMon for Linux and the SP12 cable
AvrMon for Linux and the Kanda STK200 cable/dongle
The included Linux executables depend on libc.so.6, libncurses.so.5, libstdc++.so.5, libgcc_s.so.1 and libm.so.6. The packages containing statically linked executables have been discontinued, because older and newer Linux kernels are no longer able to run the same binaries. But you can still easily compile an executable for your own system. Entering the Source directory and typing 'make' should usually do the trick.
In each of those you'll also find the uC component, as part of demo assembly source files for various uCs (AT90S2313, 2343, 4433, 8515, 8535, ATmega103). The source is easily adapted to other AVR uCs.