simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Simulating atmega169


From: Radovid Drobnjak
Subject: Re: [Simulavr-devel] Simulating atmega169
Date: Tue, 30 Jan 2007 17:53:41 +0100
User-agent: Opera Mail/9.10 (Linux)

Hi.

Hi


I have done some researches on the matter and came to the conclusion, that it would the best to adopt the program to compile on both systems, atmega169 and atmega128. I've decided to take the same approach as in the demo.c program of the avr-gcc manual examples section.

As I am also trying to learn the use of GDB (I am a real noob in this field), I've decided to experiment on a
modified version of the mentioned file demo.c.

I've written also a modified iocompat.h header file, which should overcome the differences between the chips but it is not successful and I wonder why, as I belive, that I've taken in considerance all the differences. As much as I understood, the difference shuld be mainly in I/O and configuration registriy names.
I've also omitted the -O2 flag in all Makefiles.

There are more deatailson the sequent forum post:

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=45934

In any case. If I compile my program for an atmega169 (like in the AVR Butterfly I use) it works on the chip. If I compile the same program for the atmega 128 and try to simulata it, it fails to call the timer owerflow interrupt function.

Could you please take a look to the attached files. I've got stuck, as I really do not know what to do.

THX once again for your kind help.

Radovid

p.s.

attachments: in the original_demo.zip file you can find the original demo. zip which works perfwctly fine on atmega169 aswell as in simulavrxx. The modified files are in Altered_demo_for_m169.m128.zip, which works only on the atmega169


On Tue, 23 Jan 2007 15:50:00 +0100, Klaus Rudolph <address@hidden> wrote:

Hi,


Is there any chance of simulating the atmega169 on simulavrxx (as it seems this chip is not supported yet)?

Actually it is not implemented, but it is "easy" to add a mega169 device if there is no special peripheral in mega169. I actually have no idea which is special for mega16/9. To simulate the mega16 series you simply have to shrink the ram/rom/eeprom size of mega128. For special features only provided in mega16/9 you have also to impement the specials, but only if you use them :-) And if you compile your program for a mega128 it should normaly work well enough to find all logical problems in your code. The changes in hardware for the peripherals are really small, so doing the final modifications and compilation for your target mcu should not the big problem. (I hope :-)



And how can I follow the varriables in stepping mode inside an interrupt in avr-gdb if it sais that the line numbers are hidden and afterwards it hangs in most of tries?


???
Simply set the breakpoint from ddd or gdb in the irq handler and step as you step in all the other parts of your code. There is no known problem in doing this. If you found one, please report in detail, maybe with source and Makefile so that we can reproduce it. Please do NOT add any objects! I have my own
compiler :-)
Maybe the compiler has optimzed the code so much, that your "real line of code" is thrown away.
Maybe you better step within the assembly window of ddd/gdb.
And as a third hint: If you have a c/c++ file which contains non ascii chars sometimes gdb have no chance to find the corrosponding line numbers from the debug information. This could result in terrible output from gdb/ddd
while stepping through the code.
And at last :-) Please use actual variants of avr-gcc/gdb.

I have not a real idea which problem you have, so please feel free to ask again! Your message that something is hanging while
stepping through the code is a bit "misterious" :-)

Best regards
  Klaus






--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Attachment: original_demo.zip
Description: Zip archive

Attachment: Altered_demo_for_m169-m128.zip
Description: Zip archive


reply via email to

[Prev in Thread] Current Thread [Next in Thread]