Pages: [1] 2 3 ... 5   Go Down
Author Topic: new arduino emulator - emulare  (Read 11124 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey everyone,

I wrote an emulator for Arduino in C#. It has the following features:

It has full support for the AVR instruction set. It emulates all on board devices of the atmega328p.

These are:

    * AVR memories (data, code, eeprom)
    * Watchdog timer
    * Power management
    * Interrupts (intern and extern)
    * I/O ports
    * 8 bit timer/counter with PWM
    * 16 bit timer/counter with PWM
    * 8 bit timer/counter with PWM and asynchronous operation
    * SPI
    * USART
    * 2-wire serial interface
    * Analog Comparator
    * Analog-to-Digital Converter

It has an GNU GDB RSP interface for debugging using AVR-GDB, or insight.

I have tested it a lot myself, but I was wondering if people here, would be willing to help test it.
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can find it here:

http://emulare.sourceforge.net/
Logged

0
Offline Offline
God Member
*****
Karma: 39
Posts: 986
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is pretty cool.

Does it run Bitlash?  That would be a pretty comprehensive test.

Bitlash is a tiny interpreted language shell for Arduino.  Open source and free, at http://bitlash.net

-br
http://bitlash.net
http://entropymouse.com
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you very much for the hint. I will try that  smiley
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As I am not a C programmer,  can you tell me what I need to get this up and running on a Windows box?  I've downloaded all the source files,  but don't know how to proceed from here.

Thanks...

Jim
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, I noticed where I got it wrong.

Sourceforge has put the source distribution as the main file to download. I still need to look up how to change that.

The file you need is the binary distribution.

Just do "View all files >>" and then emulare_1.0.zip

That has three files in it:
- the .exe file you can put anywhere on your drive (and is the real emulator). Double clicking on this file will open the emulator.

Then simply do "file -> program" to open the hex file. Then press the play button to start the simulation.

- it also has a text file and the license.

Idealy I should have made an installer too, but the express edition of visual studio doesn't allow for that smiley-sad

You need to have .NET 3.5 installed. But I was thinking about everyone has that these days. Since there are so many .NET applications.

I am really sorry about that.

« Last Edit: July 22, 2010, 08:56:53 am by imre » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I fixed the default download now
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks...I've downloaded the binary distribution and have the .exe file,  but I can't seem to locate the .hex file .......

I've looked through both the src distribution zip and the binary distribution zip,  but don't see any .hex files.

Care to help out this newbie again? !!

Jim
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 596
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Press the "Verify" button in the IDE while keeping the "shift" button pressed on the keyboard. In the output window (lower part of the IDE window), you'll see a lo of messages.

The important part is around the last two lines, e.g.:

Code:
/tmp/build6654863793956281218.tmp/sketch_jul22b.cpp.hex
Binary sketch size: 888 bytes (of a 30720 byte maximum)

you'll want to open a terminal window or a file manager window and look into the /tmp/build.....tmp folder. There you'll find the .hex file

HTH
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 596
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
    I found this very interesting.
Unfortunately, I've not been able to make good use of it.

Here's the sketch I compiled:

Code:
void setup() {
    Serial.begin(9600);
    pinMode(13, OUTPUT);
}


void loop() {
    Serial.println("HIGH");
    digitalWrite(13, HIGH);
    delay(1000);
    Serial.println("LOW");
    digitalWrite(13, LOW);
    delay(1000);
}

I loaded it with File -> Program. I opened the terminal and the pin window.
When I hit the "Play" button, nothing comes out on the terminal exept \u0000 sequences, and the pins in the pin window don't change...
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For some reason I like this smiley

I will try and test it for you
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm curious if this will work under mono; an emulator would be cool to have, but not so cool if it only works under Windows. One reason the Arduino has been so successful is that it is multi-platform; hopefully, this emulator can be ported to Java so that the multi-platform goodness can be retained. I will definitely have to keep an eye on this development. Glad to see it happen, whatever the case.

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

CT, USA
Offline Offline
Sr. Member
****
Karma: 2
Posts: 446
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, it runs under Mono right out of the box. I have tested it on my Ubuntu 64bit Linux box.
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for all your response.

I have been testing it mostly with assembly routines from the atmega328p document from atmel.

A lot more testing needs to go in something so complex. Thanks to the link to bitlash I will be able to do that more efficiently.

Thank you for testing this program on mono too. I wasn't sure if it would work.

There is some latency in the update of the screens. This is because of it using winforms smiley-sad I have it running on a timer now that updates the screen periodically. I should find something to fix that.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well,  something's not right.  The IDE tells me that it has stored the hex file on my c: drive as:

C:\DOCUME~1\JIM~1.HOM\LOCALS~1\Temp\build498819872858574386.tmp\Nikon_remote_lightning.cpp.hex

But when I go to that temp directory,  it's empty.  There are no subdirectories under the Temp directory. A search does not show that the file exists.

Any ideas?


« Last Edit: July 22, 2010, 04:41:21 pm by jdmartin » Logged

Pages: [1] 2 3 ... 5   Go Up
Jump to: