simulate code

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys, Im sorry to post about this I am sure its coverd everywere but I cannot find a straight awnser, It always brings to me emulations then jtag blah blah...

Basicly im wondering if it is possible to 'simulate' my code without any external hardware?

basicly all I want to simulate it for is to test delay speeds! I need to get a speed down to the us, and I have no sort of scope or anything like that, but I hear you can from simulating, but I am unsure if that involves other hardware, or is it strickly software based?

if so how would I go about doing it, with winAVR's tools. simulAVR? insight (jtag isent it).

(i need to make the jtag minice! :))

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With AVR Studio you can simulate your code. You don't need hardware for it.
You can setup the simulator at the frequency your final hardware will run. The simulator shows you the number of cycles and the time (in ns) a certain piece of code takes to execute.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ph0rkeh wrote:
I want to simulate it for is to test delay speeds! I need to get a speed down to the us, and

use VMLAB it is FREE www.amctools.com

ph0rkeh wrote:
I have no sort of scope or anything like that

see pics - SCOPE is here http://avr123.nm.ru

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

anyone know of anouther avr simulator instead of avr studio and VMLAB?

I cant even get VMLAB to simulate its own examples...

and for avr studio do I have to build the whole project in avr studio to simulate it? or can I just use avr studio to simulate projects already compiled with winAVR?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

The VMLAB should run that depend what type of chip are you using ?
On one of their web page will show what chips is supported.

As TinTinTinTin mention the Studio(4) & it does cater for the whole range of chips.
I presume you have the latest Studio.

What is your generate code assemble, elf, c & etc ?

Ken

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well threw makefile I have it set to stock so debug->ELF/DWARF2

Im using for this project is a mega16, but I hadent used anything of my own code with VMLAB, I cant even build/simulate/compile or what ever in VMLAB with there own examples, ill take a screen shot of what I mean:

everything is disabled, I cant do much of anything... the help just says 'load file' 'build database' and run .. I cant seem to do any of that

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I see you are using C & maybe someone else might shed light on that.
Is the actual C code is loaded as well as the project file ?
I am more into the assembler coder.

Have you work through their VMLAB tutorial ?

I have used it many time with out any thing been disable.
Examples works fine.
Sure you have the latest version ?

Ken

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I see you are using C

yes im using C with winAVR, and the file you see loaded is the example that came with VMLAB's under 'winAVR examples' folder

Quote:

Have you work through their VMLAB tutorial ?

not really, but I glanced at that and the help file and it doesent show much of anything about anything being disabled

Quote:

Sure you have the latest version ?

downloaded it 2 days ago from there website, so I would imagin so.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I am not using any other programs when trying out the gcctest3.

I tried out the gcctest3 demo & it works fine on my machine(XP SP2).
Looking at your snapshot, is the Target File: gcctest3.hex loaded ?
Is your Winavr are up to date (208)?
Using XP or Vista ?

Here is my snap.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ph0rkeh wrote:
and for avr studio do I have to build the whole project in avr studio to simulate it? or can I just use avr studio to simulate projects already compiled with winAVR?

AVR Studio can debug any compiled binary.

If you feed the simulator a .hex file, you'll end up stepping through the disassembly without any meaningful source code or variable watches... Not very useful, but it's a last resort option.

In addition, AVR Studio can read extended COFF files, which are produced by default in CodeVision and ImageCraft.

Most releases of WinAVR can also produce extended COFF files if you uncomment the right flags in the makefile, but there are certain limitations in its COFF support.

AVR Studio can also debug ELF/DWARF 2 files. Currently it is limited to 16-bit addressing in this format, limiting you to programs smaller than 64 kilobytes. These files can be produced by recent versions of WinAVR (with some hiccoughs along the way, most notably the migration to 32-bit addressing for handling programs larger than 64 KB).

AVR Studio can also interpret files in the UBROF-8 format. It is possible to force IAR's compilers to use that format.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pykedgew wrote:
Hi

I am not using any other programs when trying out the gcctest3.

I tried out the gcctest3 demo & it works fine on my machine(XP SP2).
Looking at your snapshot, is the Target File: gcctest3.hex loaded ?
Is your Winavr are up to date (208)?
Using XP or Vista ?

where did you get the .hex file from? did you compile it with vmlab or did it come with .hex, cause there is no gcc3.hex or what ever in that same dir with my package.

winavr is up-to-date

xp - sp2

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

Now, you got me worried.

Had a look on my work computer & you are right the hex file is not in that demo folder.
Target File: gcctest3.hex wording is in the top status bar.
If you look carefully at the bottom of the Target File in the Tab you can see it is "gcctest3.c"

Ken

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

see when I click 'open'->gcctest3.c it says 'c:\vmlab\winAVRdemo\gcctext3.c' not 'Code:Target File:gcctest3.hex'

and of course everything is disabled, I cant get into its 'code notebook' like it says so or anything unde the 'view' menu execept scope,watch, and control panel... but none of those do anything!

So I dont understand why its not working! unless mabye my winAVR version isent compat, because I have the new newest version.. the one that was let out then recalled!

what version winavr do you use, or do you even have winavr installed? cause if you dont then that cant be the prob.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem is that you are trying to load a source file (*.c or *.asm) instead of loading a project file. Using the menu Project->Open Project, try to load a project file (*.prj). For example c:\vmlab\tutorial\step01.prj After that, you should be able to compile and run your project.
Guy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

The problem is that you are trying to load a source file (*.c or *.asm) instead of loading a project file.

no of course I loaded the project file.. I tryed that the before I tryed loading the source file..

I decided to just make a simple led blink source in vmlab and let it setup the makefile and all... but when I click build (its there when I make my own) I get an error from 'avr-objcopy: invalied bfd target'... after some searching I read that error is from winavr make (of course) and the reason it does not work is that the COFF debug format is not longer supported...

does anyone know if this is true?