How to simulate virtual Arduino with GPIO over serial port

I want to simulate the Arduino and its program. then read/write to the GPIO pins using the serial port. The problem is I don’t want to change the original code and I want to use it as the real board code.
Is that possible? Is there any simulator or any other way to do it?

Not that I know.
Interesting question. Most Arduino simulators don't work very well. The problem with simulators is that you might waste your time when the simulator itself causes the problems.

This does not really answer your question but may help. I sort of do that, I have debugging routines that I include with my code and normally use a manual interrupt to trigger it however I can also do it in my code. It will dump any or all the variables, EEPROM, RAM, pin values, etc. It works nicely but it does take code and some RAM space. When I get close in memory I go to a MEGA. The nice part everything runs in real time until the debug code runs. Another thing I do is I purchased one of the inexpensive logic analyzers and use that for timing etc. I typically use pin 7 as the debug pin (no special reason), it was the first one I used a few years back. I have a function called ping(); that simply sets the debug pin high and then sets it low. The logic analyzer will trigger on it and I know if it got to that section of code. It is also great for timing functions etc.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.