simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] stimulus question, vectors at code start


From: Theodore A. Roth
Subject: Re: [Simulavr-devel] stimulus question, vectors at code start
Date: Mon, 17 Feb 2003 13:07:54 -0800 (PST)


On Mon, 17 Feb 2003, Marcell Gal wrote:

:) Hi Guys,
:)
:) I have 3 questions:
:) - stimulus of the pins of simulavr virtual device from other program
:) - avr-gcc compiles 4 byte jump instructions to the start of text section
:) instead of 2 byte vectors
:) - simulavr -d atmega128 state
:)
:) I am avr-beginner, so forget me if I ask some of this is documented
:) but I could not find it.
:)
:) 1. The first question is if I have the environment of an atmega128
:)  simulated in computer (in C under linux, if that matters). and
:) would like to run simulavr, how can I interface them?
:) I'd like to be able to call some rutines to notify when atmega128
:) inputs change and be notified when simulavr changes state of
:) some output pins (I think these routines could pass the time
:) as a parameter counted in ticks maybe).
:) Maybe messages via tcp port...
:) Is this supported ?

This is not supported right now.

It's been on my todo list for way too long. Once I get some other
projects done, I'll be working on this, but it could still be a while.

:)
:) ==========================
:) 2. This is probably very easy, please help:
:) a.out:
:)         avr-gcc  -mmcu=atmega103 -I/usr/avr/include eficell.c
:)
:) # avr-objdump -d a.out |head  shows that
:) #eficell:     file format elf32-avr
:) #Disassembly of section .text:
:) #00000000 <.text>:
:) #       0:       0c 94 30 00     jmp     0x60
:) # .....
:) #      5c:       0c 94 50 00     jmp     0xa0
:) #
:) #00000060 <_real_init_>:
:) #      60:       11 24           eor     r1, r1
:) #....
:)
:) # We can see it begins with 4 byte jumps instead of
:) # 2 byte interrupt vectors (starting with reset, interrupt 1, etc..)
:) How can I make a binary image that could be downloaded to atmega128 flash?

I don't see what the problem is here. You _must_ use the 4 byte jumps
for the vector table with the mega128/103. (see the datasheets).

See

  
http://savannah.nongnu.org/download/avr-libc/doc/avr-libc-user-manual/demo_project.html

For how to create the .hex or .srec file for uploading into the
device.

:) ===============================
:)
:) 3. I understand that simulavr's primary target is at90 .... at the moment,
:) I'd like to know how well atmega128 is simulated. Probaly this is
:) 2 questions, how well
:)  - avr5 instructions
:)  - atmega128  IO
:) are simulated ?

simulavr handles all instructions (that I know of ;-) for the most
part.

The existing mega128 support is basically just to handle the
flash/eeprom/sram sizes. The io support is severely lacking right now.

Ted Roth





reply via email to

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