Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Its a long time since we used MPSim, but with the Arduino IDE find all thats needed, is to run the code on the Uno or similar and use the inbuilt Serial Monitor along with code instructions to give feedback.
If you want to start using Breakpoints and serious debugging then use something like Atmel Studio IDE with Visual Micro plug in, plenty of good Ytubes on such debugging.
Have to say, for general hobby proects, have yet to find the need to use that kind of debugging with C++ and Arduino, though depends on your projects.
Using mpsim, I could single-step and watch registers and flags set, clear and overflow.
I could find conditions not be true to explain why my branch wouldn't work.
I could single-step to a line of code, modify registers to the condition I needed, then continue single stepping or just run at that point.
I could also single-step to count clock cycles for timing time-critical sections.
Or just let it run and watch it eat itself apart and crash. But, I'd know how many cycles it took. Lol.
I was a great tool, and will use it again next time I PIC something.
There HAS TO BE a tool as amazing OR BETTER by now for ATMEL/ARDUINO.
The serial monitor itself has a lot of overhead (IMHO) and not always practical for debug.
MPSIM was truely a window into what's going on.
Microchip nowadays says "simulate it in real hardware". It is reasonable. After simulating all my specific delay routines for a new clock frequency, when starting with MPLABX 5.25 plus PICkit4 and ICSP, I did not look back.
My software, now, was (is) run in the hardware itself. What could be better?
Assume you were using Pic Assembly code or if using C, quiet familiar with it.
Many of us here also used Pic Assembly and moved over to Arduino C++ without feeling the need for MpSim, its just a different way and think you will get used to it.
C++ is one of the most popular languages, but not heard of any equivalent to MPSim, which surely if others felt it was needed they would have produced one by now ?
Any timing, branching and similar debugging can be done using the Serial monitor, plus you can readily code your program it to give live , interactive feedback.
The screenshot below shows how we use it to report the status of various flags/registers, ADC values being read and the X/Y values of the touch screen where its currently being pressed, can you do all that with a Sim program ?