Arduino simulator for debugging

I ran into an Arduino Simulator from www.arduino.com.au.
The Free version has a 1minute delay on opening sketches and is code limited to 100 lines.
The Pro Version has no such limitations but is to be licensed. ( very strange, I thought Arduino is open source ; )

There seem to be other simulators available ArduinoSim, Simuino , ... (?)

I don't expect to simulate timing behavior identical ( simulating every processor clock cycle in exact real time )
but the ability to debug Arduino sketches, looks interesting to me, eventually saving lots of upload cycles with different Serial.print() statements.

Who has experience with those simulators?
Do they behave identical to a real Arduino in terms of code compilation, memory limitations ?

Can you interactively / programmatically control inputs ? (simulate real world behavior ?)

Can you simulate output to led / lcd / scope or at least read pin values and variables content ?

I found a forum thread http://arduino.cc/forum/index.php/topic,81945.0.html from begin of this year, which seems about a very early version of this one.

Is it worth spending some time on examining the current state or different ones, regarding my expectations?

( simulating every processor clock cycle in exact real time )

That would require an emulator.

Atmel makes several Debuggers for the ATMega328P chips:

AVR Dragon, $49
The AVR Dragon sets a new standard for low cost development tools for 8-bit and 32-bit AVR devices with On Chip Debug (OCD) capability. It can perform a symbolic debug on all devices with OCD with SPI, JTAG, PDI (selected devices), high voltage serial programming, parallel programming, and aWire modes, and supports debugging using SPI, JTAG, PDI interfaces.

A development area lets designers build their own circuitry or add sockets for the desired device footprint. The debugger also supports NanoTrace, depending on the OCD module on the AVR devic, using the target device's memory.

Key Features•Supports up to 3 hardware program breakpoints or 1 maskable data breakpoint (depending on the OCD mo
•Supports up to 32 software breakpoints
•On-board 128kB SRAM for fast statement-level stepping
•Robust level converters support 1.8V to 5.5V target operation
•Uploads 256Kb code in ~60 seconds (XMEGA using JTAG interface)
•Full-speed USB 2.0 compliant host interface (12 MB/s)
•Firmware upgradeable for supporting future AVR devices
•Supports NanoTrace (depending on the OCD module on the AVR device; uses target device's memory)
•USB powered, and capable of sourcing power to an external target

AVR JTAGICE mkII, $299
A mid-range development tool for Atmel 8-bit and 32-bit AVR devices with on-chip debugging for source level symbolic debugging, NanoTrace (if supported by the device) and device programming. It supports SP, JTAG, PDI, and aWire modes and interface debugging. The tool is firmware upgradeable to support future AVR devices.

Key Features•Supports up to 3 hardware program breakpoints or 1 maskable data breakpoint (depending on the OCD mo
•Supports symbolic debug of complex data types including scope information
•Supports up to 128 software breakpoints
•Includeson-board 512kB SRAM for fast statement-level stepping
•Level converters support 1.8V to 5.5V target operation
•Uploads 256Kb code in ~30 seconds (XMEGA using JTAG interface)
•Full-speed USB 2.0 compliant (12 MB/s) and RS-232 host interfaces
•Externally or USB powered

A professional development tool for all Atmel 8-bit and 32-bit AVR devices with On-Chip Debug capability. It is used for source level symbolic debugging, program trace and device programming. AVR ONE! supports the complete development cycle and is is the fastest debugging tool offered from Atmel.

AVR ONE!, $599
It supports SPI, JTAG, PDI, and aWire programming modes and debugging using debugWIRE, JTAG, PDI, and aWire interfaces. It also supports LiveDebug, which makes it possible to attach to a running target non-intrusively, and the Nexus auxiliary interface for high-speed program, data or ownership trace at up to 200MHz in either buffered or streaming mode. AVR ONE! is driven by powerful FPGA which provides high-speed data transfer between the host PC and the target AVR device, facilitating rapid program download and a most responsive debugging experience.

Key Features•Supports up to 3 hardware program breakpoints or 1 maskable data breakpoint (depending on the OCD mo
•Supports symbolic debug of all datatypes including scope information
•Supports up to 128 software breakpoints
•Includes on-board 128kB SRAM for fast statement-level stepping
•Robust level converters support 1.8V to 5.5V target operation
•AUX trace supports up to 3.3V. A 5.5V tolerant trace probe is available
•Uploads 256Kb code in ~8 seconds (XMEGA using JTAG interface)
•High-speed USB 2.0 compliant host interface (480 MB/s) for easy handling of trace data
•Fully adjustable high-resolution clock up to 64MHz
•Supports LiveDebug (OCD specific)
•Firmware upgradeable for supporting future AVR devices
•128MB SDRAM for AUX trace data buffering in linear or circular modes
•Supports NanoTrace (depending on the OCD module on the AVR device; uses target device's memory)

JTAGICE 3, $199
Mid-range development tool for Atmel 8-bit and 32-bit AVR microcontrollers with on-chip debugging for source level symbolic debugging, NanoTrace (if supported by the device) and device programming.

Key Features•Supports JTAG, aWire, SPI and PDI interfaces
•3 hardware program breakpoints and 1 maskable data breakpoint (depending on the OCD module on the AV
•Symbolic debug of complex data types including scope information
•Up to 128 software breakpoints
•1.8V to 5.5V target operation
•Uploads 256KB code in ~14 seconds (XMEGA using JTAG interface)
•USB powered

Can do a lot with serial.print, serial.write statements too.

Thanks for your hints, CrossRoads.
Opening mind is always good.
On chip debugging was not I was really looking for, currently.

Can do a lot with serial.print, serial.write statements too.

is very correct, but that's somehow on-chip as well !

GitHub - cosaka/Simulino: Arduino simulation project sits on top of PROTEUS

The more I think about my intuitive requirements (behave identical to a real Arduino in terms of code compilation, memory limitations)
my ideas are more about the atmel processor than the arduino built around it.

So perhaps I should go to avr level rather, for my simulation/debugging ideas.
In the avr-gcc toolchain there's also a simulavr.

That's not in the arduino forum scope any more, I think.
Perhaps I spend the minute waiting and play with the " Arduino Simulator " Demo version.

Michael, thanks for mentioning Simulator for Arduino. Most Arduino users are pretty much simulated out - there was a lot of discussion a few months ago, so we try to minimize our posts, but we don't mind replying to questions. I saw on the Other Software Development that someone is looking for 4.5k to develop a new Simulator - good luck.

Writing a Simulator is very hard, and we would like to think we are now mostly over the hill, and if anyone wants to build a new one - good luck it will sap all your energy. There are still many areas for improvement in the Simulator for Arduino and briefly these are:

  • Implement custom libraries - this means walking through each library in turn
  • Add variant Arduino boards such as Lilypad and Nano - this is now working but not released
  • Add French and Italian - partly done for the Menus only at this stage but not released
  • Improve error checking and handling
  • Improve help to be more Arduino friendly
  • Too many other issues to mention but mostly minor

Most of the Pro Users are very positive but we do get some angry remarks about a few bugs and we put this down to high-end professionals driven by intense passion.

With Emulators, these usually use JTAG which means losing 4 pins from PORTC which usually means the program cannot be run if you wan to use all the pins. The exception is the XMega but unfortunately there is not an Arduino for Xmega yet. The ARM Due looks very impressive but is not out yet.

Also, the Free version delay is only 30 seconds but increases by one second every time a new sketch is loaded. The idea being that is the Simulator gets used a lot, it becomes important to purchase the Pro Licence. As far as open source, we have not ruled that out, but we do need a method now to fund development of the project. The Arduino Team has made their money from selling 500k Arduino boards a year, and I heard a rumour that they are each worth over 10M each.

Thanks for your feedback.
I posted here (Programming Questions instead of Other Software Development) because I was not - too - interested in how to build a simulator, but how to use one to improve my own programming exerience.

There are still many areas for improvement in the Simulator for Arduino and briefly these are:

  • Implement custom libraries - this means walking through each library in turn

Do I understand that you do not start out on a compiled elf file, but interpret the given source code independently?
I'd fully understand if your simulator does not step into code it does not have source text for ( and doesn't count for your limiting 100 ; )
but "just" executes the compiled machine code. And I see it's not trivial to emulate the processor (e.g. display all pin states modified "somehow" )

Well, I'll give it a try,
Thanks for your comment!

Hi Michael_x, yes the Simulator works by reading and interpreting each line. This may sound easy but it requires that the program remember which loop it is in, the results of previous if statements when else statements are found and many other intricacies.

We have just released v0.96A which now has the Lilypad and Nano, and we will add the USB-based Leonardo next. Languages have also been added for the menu ( we were a few days earlier than Arduino v1.01 which now has multi-language support). We already have a long buglist for v0.96A which is part of the reason why the price is $8 and not $18. Also, we have recently added a Pro version license renewal at 50% off to ensure early adopters can keep their license current. The main problem we have now is a flaky Paypal interface -we have plans to upgrade to a more professional software registration agency soon.