Go Down

Topic: Hardware emulation in the computer (Read 1 time) previous topic - next topic


Aug 22, 2010, 05:42 pm Last Edit: Aug 22, 2010, 05:44 pm by LMI1 Reason: 1
If you want suggestions for new features to included in version 1.0, here is one. Perhaps it is more realistic to hope these in version 2.0

Running sketches in the computer and results go to the hardware Arduino board and to the screen. Running programs in the computer means of course tracing, stepping and other debugging features are easy to implement.

Debugging is now hard, a lot of printlines. Emulation would help a lot. It would probably run slower than running programs normally but still it would help.

How about also selling boards with emulation "firmware" that is with emulation sw instead of bootloader. That would help with getting better speed.


I have developed for PICs, in fact it was what I learnt microcontrollers on.  The PIC ide has a built in simulator and quite frankly it is worthless because of a total lack of external stimuli.

Now, as for a in circuit debugger, the atmega chips have built in support for a ICD, but the actual ICD devices tend to be quite expensive, although support for them within the arduino IDE would be nice.  ICD and ICE is rather complicated though, so I can't see it happening.


I actually enjoy troubleshooting bugs in my code. Helps me learn more from the mistakes. Print statements work well enough for me. Sometimes I just write new small sketches to test out a new function I'm trying to use to see where my logic is wrong. I guess coming from a hardware troubleshooting backround helped me a lot in trying to solve software bugs.
Once I can get the compiler to compile without errors I'm off to a good start, prior to that no so much... ;)



I mean by emulation a system where program runs in a computer with hardware connected. Arduino board sw would just transfer io status between computer and peripherals.

To UltraMagnus: Yes emulation is hard. So, probably it will have to wait before some real hacker makes it for himself.

To retrolefty: Searching bugs is nice but when you are able to step line by line your code, you will see how much more fun it is, and faster too.


When I was in school, we had a micro platform based on the (then-)popular 8051.  The boot loader contained a debugger.  It allowed for setting breakpoints (or calling a breakpoint from the C code) before executing the code.  Once broke, the monitor allowed viewing of memory locations and other activities.

It seems like a monitor like that would be useful in Arduino.  It seems like we could get information like memory addresses for variables and/or sub routines and list them in the IDE for reference.  

(In school we had to examine the ASM files or setup use printf's to determine the addresses.)

If such a basic debugger was a bootloader (perhaps debugging-bootloader) then feeding the data to a hardware "emulator" would be relatively trivial.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up