Debugger: Drive Circuit.

Since 0.2.9 there is an option to "synchronize" circuit simulation to debugger execution.

Click on the Editor document you want to debug and go to properties tab.
Under the compiler section tou will see "Drive Circuit" property wich you can set to true or false.



By default it is set to false so circuit simulation will run at normal speed while the mcu execution will be controlled by debugger steps.
This is equivalent to run the mcu in a real circuit but with firmware execution controlled by JTAG interface or similar.

Sometimes this way is not enought to observe some characteristics or features of our firmware.
For example an oscilloscope attached to an mcu ouput that is generating a wave will not "see" that wave or can't read it's frequency.
Or for example a servo motor will not behave correctly as the frequencies are changed. 

When debugger is "Driving Circuit" (Drive Circuit=true), circuit simulation will run synchronized to debugger execution, that is: circuit will only run the exact number of steps it would run in normal simulation for each debugger step, then it will stop until another debugger step is executed.

This way any element in the circuit will "see" mcu pin changes in the correct time and behave like in normal circuit simulation.

But this way has it's own downsides:
For example in the blinking led case when the output is written to high the led will not turn on inmediatly, wich looks wrong but indeed is correct because circuit simulation will "freeze" just afther the output becomes high, in that moment no current is flowing through the led.
If you put a probe in that output you will see the voltage already changed to high, but led still looks off because circuit simulation "freezed" just in that step.


To see it in action please watch this video:
https://youtu.be/uNhKjuCLs2o