Go Down

Topic: new arduino emulator - emulare (Read 14739 times) previous topic - next topic


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.


You can find it here:



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



Thank you very much for the hint. I will try that  :)


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.




Jul 22, 2010, 03:52 pm Last Edit: Jul 22, 2010, 03:56 pm by imre Reason: 1
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 :(

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.


I fixed the default download now


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? !!



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: [Select]

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



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

Here's the sketch I compiled:

Code: [Select]

void setup() {
   pinMode(13, OUTPUT);

void loop() {
   digitalWrite(13, HIGH);
   digitalWrite(13, LOW);

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...


For some reason I like this :)

I will try and test it for you


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.

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


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


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 :( I have it running on a timer now that updates the screen periodically. I should find something to fix that.


Jul 22, 2010, 11:15 pm Last Edit: Jul 22, 2010, 11:41 pm by jdmartin Reason: 1
Well,  something's not right.  The IDE tells me that it has stored the hex file on my c: drive as:


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?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131