AVR memory dump

This is more a curious than a useful project.

While I was writing the assembler source for the clock I thought that it would be nice to take a look into the registers and memory of the controller.

So I've written an interrupt routine that sends all port, register, memory and eeprom data over the UART port to the PC. Now I only have to trigger the interrupt and the controller sends all that data to the PC into a file. Of course, you can send the data using a function call or something like that if you want to see why your program does not work.

Now it was possible to examine the register, flags and so on with an hex editor. But it was much work to find the right location in the file of each register.

Finaly I wrote a python script that takes the raw dump and creates an easy to read html-file. The registers are numbered, the ports and bits are named.

After everything worked I've never used this code for debuging asm-code, because I used the C-compiler avr-gcc for further projects.

The code is designed for the controllers AT90S2313, AT90S4433, AT90S8515 and AT90S8535.

Download:

The license is public domain, so do whatever you want. This package comes with no warranty.

The programming languages are AVR-assembler and python.
Package: avrdump.tar.gz

the result

Below you can see the output of the python script. Every section of the controller has a different color. The stackpointer has a red mark in the memory section.

avr-dump: device "AT90S2313"

register

r00xFF , 11111111b , 255 , "."r80xFF , 11111111b , 255 , "."r160x15 , 00010101b , 21 , "."r240xEF , 11101111b , 239 , "."
r10xFF , 11111111b , 255 , "."r90xFF , 11111111b , 255 , "."r170xFF , 11111111b , 255 , "."r250xFF , 11111111b , 255 , "."
r20xFF , 11111111b , 255 , "."r100xFF , 11111111b , 255 , "."r180xFF , 11111111b , 255 , "."r260xFF , 11111111b , 255 , "."
r30xEF , 11101111b , 239 , "."r110xFF , 11111111b , 255 , "."r190xFF , 11111111b , 255 , "."r270xFF , 11111111b , 255 , "."
r40xFF , 11111111b , 255 , "."r120xFF , 11111111b , 255 , "."r200xFF , 11111111b , 255 , "."r280xFF , 11111111b , 255 , "."
r50xFF , 11111111b , 255 , "."r130xFF , 11111111b , 255 , "."r210xFF , 11111111b , 255 , "."r290x33 , 00110011b , 51 , "3"
r60xFF , 11111111b , 255 , "."r140xFF , 11111111b , 255 , "."r220xFF , 11111111b , 255 , "."r300x22 , 00100010b , 34 , """
r70xFF , 11111111b , 255 , "."r150xFF , 11111111b , 255 , "."r230xFF , 11111111b , 255 , "."r310x11 , 00010001b , 17 , "."

ports

0x28ACSRACD=0AC0=0ACI=1ACIE=0ACIC=0ACIS1=0ACIS0=0analog comparator
0x29UBRR0x19 , 00011001b , 25 , "."UART baud rate register
0x2AUCRRXCIE=0TXCIE=0UDRIE=0RXEN=0TXEN=1CHR9=0RXB8=1TXB8=0UART control register
0x2BUSRRXC=0TXC=0UDRE=0FE=0OR=0UART status register
0x2CUDR0x00 , 00000000b , 0 , "."UART I/O data register
0x30PIND0x7C , 01111100b , 124 , "|"port d input
0x31DDRD0x00 , 00000000b , 0 , "."port d direction register
0x32PORTD0x00 , 00000000b , 0 , "."port d output/pullup
0x36PINB0x16 , 00010110b , 22 , "."port b input
0x37DDRB0xFF , 11111111b , 255 , "."port b direction register
0x38PORTB0x16 , 00010110b , 22 , "."port b output/pullup
0x3CEECREEMWE=0EEWE=0EERE=0EEPROM control
0x3DEEDR0x00 , 00000000b , 0 , "."EEPROM data register
0x3EEEAR0x00 , 00000000b , 0 , "."EEPROM adress register
0x41WDTCRWDTOE=0WDE=0WDP2=0WDP1=0WDP0=0watchdog timer control
0x44ICR1L0x00 , 00000000b , 0 , "."timer/counter1- low(input capture register)
0x45ICR1H0x00 , 00000000b , 0 , "."timer/counter1- high(input capture register)
0x4AOCR1AL0x00 , 00000000b , 0 , "."timer/counter1- low(compare register)
0x4BOCR1AH0x00 , 00000000b , 0 , "."timer/counter1- high(compare register)
0x4CTCNT1L0x00 , 00000000b , 0 , "."timer/counter1- low(counter register)
0x4DTCNT1H0x00 , 00000000b , 0 , "."timer/counter1- high(counter register)
0x4ETCCR1BICNC1=0ICES1=0CTC1=0CS12=0CS11=0CS10=0timer/counter1 control register
0x4FTCCR1ACOM1A1=0COM1A0=0PWM11=0PWM10=0timer/counter1 control register
0x52TCNT00x00 , 00000000b , 0 , "."timer/counter0 (8bits)
0x53TCCR0CS02=0CS01=0CS00=0timer prescale register
0x55MCUCRSE=0SM=0ISC11=0ISC10=0ISC01=1ISC00=1MCU control
0x58TIFRTOV1=0OCF1A=0ICF1=0TOV0=0timer interrupt flags
0x59TIMSKTOIE1=0OCIE1A=0TICIE1=0TOIE0=0timer interupt mask
0x5AGIFRINTF1=0INTF0=0interrupt flags
0x5BGIMSKINT1=0INT0=1interrupt mask
0x5DSPL0xDB , 11011011b , 219 , "."low(stack pointer)
0x5FSREGI=0T=0H=0S=0V=0N=0Z=0C=0flag register

memory

0x600x00 , 00000000b , 0 , "."0x800x20 , 00100000b , 32 , " "0xA00x00 , 00000000b , 0 , "."0xC00x00 , 00000000b , 0 , "."
0x610x40 , 01000000b , 64 , "@"0x810x20 , 00100000b , 32 , " "0xA10x88 , 10001000b , 136 , "."0xC10x00 , 00000000b , 0 , "."
0x620x02 , 00000010b , 2 , "."0x820x00 , 00000000b , 0 , "."0xA20x00 , 00000000b , 0 , "."0xC20x00 , 00000000b , 0 , "."
0x630x00 , 00000000b , 0 , "."0x830x00 , 00000000b , 0 , "."0xA30x00 , 00000000b , 0 , "."0xC30x04 , 00000100b , 4 , "."
0x640x00 , 00000000b , 0 , "."0x840x00 , 00000000b , 0 , "."0xA40x00 , 00000000b , 0 , "."0xC40x00 , 00000000b , 0 , "."
0x650x00 , 00000000b , 0 , "."0x850x00 , 00000000b , 0 , "."0xA50x00 , 00000000b , 0 , "."0xC50x00 , 00000000b , 0 , "."
0x660x1C , 00011100b , 28 , "."0x860x04 , 00000100b , 4 , "."0xA60x00 , 00000000b , 0 , "."0xC60x00 , 00000000b , 0 , "."
0x670xC0 , 11000000b , 192 , "."0x870x12 , 00010010b , 18 , "."0xA70x08 , 00001000b , 8 , "."0xC70x00 , 00000000b , 0 , "."
0x680x00 , 00000000b , 0 , "."0x880x00 , 00000000b , 0 , "."0xA80x00 , 00000000b , 0 , "."0xC80x0A , 00001010b , 10 , "."
0x690x00 , 00000000b , 0 , "."0x890x00 , 00000000b , 0 , "."0xA90x08 , 00001000b , 8 , "."0xC90x00 , 00000000b , 0 , "."
0x6A0x00 , 00000000b , 0 , "."0x8A0x00 , 00000000b , 0 , "."0xAA0x20 , 00100000b , 32 , " "0xCA0x00 , 00000000b , 0 , "."
0x6B0x00 , 00000000b , 0 , "."0x8B0x04 , 00000100b , 4 , "."0xAB0x00 , 00000000b , 0 , "."0xCB0xB2 , 10110010b , 178 , "."
0x6C0x00 , 00000000b , 0 , "."0x8C0x00 , 00000000b , 0 , "."0xAC0x00 , 00000000b , 0 , "."0xCC0xB1 , 10110001b , 177 , "."
0x6D0x00 , 00000000b , 0 , "."0x8D0x00 , 00000000b , 0 , "."0xAD0x00 , 00000000b , 0 , "."0xCD0xB0 , 10110000b , 176 , "."
0x6E0x08 , 00001000b , 8 , "."0x8E0x00 , 00000000b , 0 , "."0xAE0x20 , 00100000b , 32 , " "0xCE0xAF , 10101111b , 175 , "."
0x6F0x48 , 01001000b , 72 , "H"0x8F0x00 , 00000000b , 0 , "."0xAF0x00 , 00000000b , 0 , "."0xCF0xAE , 10101110b , 174 , "."
0x700x08 , 00001000b , 8 , "."0x900x01 , 00000001b , 1 , "."0xB00x00 , 00000000b , 0 , "."0xD00xAD , 10101101b , 173 , "."
0x710x40 , 01000000b , 64 , "@"0x910x00 , 00000000b , 0 , "."0xB10x00 , 00000000b , 0 , "."0xD10xAC , 10101100b , 172 , "."
0x720xA0 , 10100000b , 160 , "."0x920x00 , 00000000b , 0 , "."0xB20x00 , 00000000b , 0 , "."0xD20xAB , 10101011b , 171 , "."
0x730x00 , 00000000b , 0 , "."0x930x00 , 00000000b , 0 , "."0xB30x00 , 00000000b , 0 , "."0xD30xAA , 10101010b , 170 , "."
0x740x00 , 00000000b , 0 , "."0x940x00 , 00000000b , 0 , "."0xB40x00 , 00000000b , 0 , "."0xD40xA9 , 10101001b , 169 , "."
0x750x80 , 10000000b , 128 , "."0x950x00 , 00000000b , 0 , "."0xB50x00 , 00000000b , 0 , "."0xD50xA8 , 10101000b , 168 , "."
0x760x00 , 00000000b , 0 , "."0x960x00 , 00000000b , 0 , "."0xB60x00 , 00000000b , 0 , "."0xD60xA7 , 10100111b , 167 , "."
0x770x04 , 00000100b , 4 , "."0x970x80 , 10000000b , 128 , "."0xB70x00 , 00000000b , 0 , "."0xD70xA6 , 10100110b , 166 , "."
0x780x00 , 00000000b , 0 , "."0x980x00 , 00000000b , 0 , "."0xB80x00 , 00000000b , 0 , "."0xD80xA5 , 10100101b , 165 , "."
0x790x00 , 00000000b , 0 , "."0x990x00 , 00000000b , 0 , "."0xB90x00 , 00000000b , 0 , "."0xD90xA4 , 10100100b , 164 , "."
0x7A0x00 , 00000000b , 0 , "."0x9A0x02 , 00000010b , 2 , "."0xBA0x00 , 00000000b , 0 , "."0xDA0xA3 , 10100011b , 163 , "."
0x7B0x40 , 01000000b , 64 , "@"0x9B0x00 , 00000000b , 0 , "."0xBB0x40 , 01000000b , 64 , "@"0xDB0xA2 , 10100010b , 162 , "."
0x7C0x00 , 00000000b , 0 , "."0x9C0x04 , 00000100b , 4 , "."0xBC0x82 , 10000010b , 130 , "."0xDC0x00 , 00000000b , 0 , "."
0x7D0x00 , 00000000b , 0 , "."0x9D0x00 , 00000000b , 0 , "."0xBD0x00 , 00000000b , 0 , "."0xDD0x8E , 10001110b , 142 , "."
0x7E0x00 , 00000000b , 0 , "."0x9E0x00 , 00000000b , 0 , "."0xBE0x00 , 00000000b , 0 , "."0xDE0x00 , 00000000b , 0 , "."
0x7F0x00 , 00000000b , 0 , "."0x9F0x02 , 00000010b , 2 , "."0xBF0x80 , 10000000b , 128 , "."0xDF0x33 , 00110011b , 51 , "3"

eeprom

0x000xFF , 11111111b , 255 , "."0x200xFF , 11111111b , 255 , "."0x400xFF , 11111111b , 255 , "."0x600xFF , 11111111b , 255 , "."
0x010xFF , 11111111b , 255 , "."0x210xFF , 11111111b , 255 , "."0x410xFF , 11111111b , 255 , "."0x610xFF , 11111111b , 255 , "."
0x020xFF , 11111111b , 255 , "."0x220xFF , 11111111b , 255 , "."0x420xFF , 11111111b , 255 , "."0x620xFF , 11111111b , 255 , "."
0x030xFF , 11111111b , 255 , "."0x230xFF , 11111111b , 255 , "."0x430xFF , 11111111b , 255 , "."0x630xFF , 11111111b , 255 , "."
0x040xFF , 11111111b , 255 , "."0x240xFF , 11111111b , 255 , "."0x440xFF , 11111111b , 255 , "."0x640xFF , 11111111b , 255 , "."
0x050xFF , 11111111b , 255 , "."0x250xFF , 11111111b , 255 , "."0x450xFF , 11111111b , 255 , "."0x650xFF , 11111111b , 255 , "."
0x060xFF , 11111111b , 255 , "."0x260xFF , 11111111b , 255 , "."0x460xFF , 11111111b , 255 , "."0x660xFF , 11111111b , 255 , "."
0x070xFF , 11111111b , 255 , "."0x270xFF , 11111111b , 255 , "."0x470xFF , 11111111b , 255 , "."0x670xFF , 11111111b , 255 , "."
0x080xFF , 11111111b , 255 , "."0x280xFF , 11111111b , 255 , "."0x480xFF , 11111111b , 255 , "."0x680xFF , 11111111b , 255 , "."
0x090xFF , 11111111b , 255 , "."0x290xFF , 11111111b , 255 , "."0x490xFF , 11111111b , 255 , "."0x690xFF , 11111111b , 255 , "."
0x0a0xFF , 11111111b , 255 , "."0x2a0xFF , 11111111b , 255 , "."0x4a0xFF , 11111111b , 255 , "."0x6a0xFF , 11111111b , 255 , "."
0x0b0xFF , 11111111b , 255 , "."0x2b0xFF , 11111111b , 255 , "."0x4b0xFF , 11111111b , 255 , "."0x6b0xFF , 11111111b , 255 , "."
0x0c0xFF , 11111111b , 255 , "."0x2c0xFF , 11111111b , 255 , "."0x4c0xFF , 11111111b , 255 , "."0x6c0xFF , 11111111b , 255 , "."
0x0d0xFF , 11111111b , 255 , "."0x2d0xFF , 11111111b , 255 , "."0x4d0xFF , 11111111b , 255 , "."0x6d0xFF , 11111111b , 255 , "."
0x0e0xFF , 11111111b , 255 , "."0x2e0xFF , 11111111b , 255 , "."0x4e0xFF , 11111111b , 255 , "."0x6e0xFF , 11111111b , 255 , "."
0x0f0xFF , 11111111b , 255 , "."0x2f0xFF , 11111111b , 255 , "."0x4f0xFF , 11111111b , 255 , "."0x6f0xFF , 11111111b , 255 , "."
0x100xFF , 11111111b , 255 , "."0x300xFF , 11111111b , 255 , "."0x500xFF , 11111111b , 255 , "."0x700xFF , 11111111b , 255 , "."
0x110xFF , 11111111b , 255 , "."0x310xFF , 11111111b , 255 , "."0x510xFF , 11111111b , 255 , "."0x710xFF , 11111111b , 255 , "."
0x120xFF , 11111111b , 255 , "."0x320xFF , 11111111b , 255 , "."0x520xFF , 11111111b , 255 , "."0x720xFF , 11111111b , 255 , "."
0x130xFF , 11111111b , 255 , "."0x330xFF , 11111111b , 255 , "."0x530xFF , 11111111b , 255 , "."0x730xFF , 11111111b , 255 , "."
0x140xFF , 11111111b , 255 , "."0x340xFF , 11111111b , 255 , "."0x540xFF , 11111111b , 255 , "."0x740xFF , 11111111b , 255 , "."
0x150xFF , 11111111b , 255 , "."0x350xFF , 11111111b , 255 , "."0x550xFF , 11111111b , 255 , "."0x750xFF , 11111111b , 255 , "."
0x160xFF , 11111111b , 255 , "."0x360xFF , 11111111b , 255 , "."0x560xFF , 11111111b , 255 , "."0x760xFF , 11111111b , 255 , "."
0x170xFF , 11111111b , 255 , "."0x370xFF , 11111111b , 255 , "."0x570xFF , 11111111b , 255 , "."0x770xFF , 11111111b , 255 , "."
0x180xFF , 11111111b , 255 , "."0x380xFF , 11111111b , 255 , "."0x580xFF , 11111111b , 255 , "."0x780xFF , 11111111b , 255 , "."
0x190xFF , 11111111b , 255 , "."0x390xFF , 11111111b , 255 , "."0x590xFF , 11111111b , 255 , "."0x790xFF , 11111111b , 255 , "."
0x1a0xFF , 11111111b , 255 , "."0x3a0xFF , 11111111b , 255 , "."0x5a0xFF , 11111111b , 255 , "."0x7a0xFF , 11111111b , 255 , "."
0x1b0xFF , 11111111b , 255 , "."0x3b0xFF , 11111111b , 255 , "."0x5b0xFF , 11111111b , 255 , "."0x7b0xFF , 11111111b , 255 , "."
0x1c0xFF , 11111111b , 255 , "."0x3c0xFF , 11111111b , 255 , "."0x5c0xFF , 11111111b , 255 , "."0x7c0xFF , 11111111b , 255 , "."
0x1d0xFF , 11111111b , 255 , "."0x3d0xFF , 11111111b , 255 , "."0x5d0xFF , 11111111b , 255 , "."0x7d0xFF , 11111111b , 255 , "."
0x1e0xFF , 11111111b , 255 , "."0x3e0xFF , 11111111b , 255 , "."0x5e0xFF , 11111111b , 255 , "."0x7e0xFF , 11111111b , 255 , "."
0x1f0xFF , 11111111b , 255 , "."0x3f0xFF , 11111111b , 255 , "."0x5f0xFF , 11111111b , 255 , "."0x7f0xFF , 11111111b , 255 , "."

back to my page index
created with quanta 3.1, werner.ho(AT)gmx.de 2003-09-25