Software Simulator

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
dariods
Posts: 25
Joined: 26 Apr 2023 07:12

Software Simulator

#1 Post by dariods » 29 Apr 2023 13:04

I'm making an amp-hour meter. The main loop must execute every second. I wanted to check the time taken by the loop in the simulator similar to the stopwatch function in Mplabx simulator. I have put a breakpoint at the end of the loop at a 1 ms delay. If I start the debugging in MicroC it halts at the first line of the code then I have to repeatedly press F7. But when the code has to read adc value or initialize the LCD display it goes into a loop. To come out I press F8 or Ctrl+F8. It comes out but on repeatedly doing the stopwatch just keeps increasing, no stop at any breakpoint.
If I try to set voltage at any adc pin, I can only set 1 or zero. How do I get the time taken for completion of 1 loop?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Software Simulator

#2 Post by filip » 31 May 2023 07:36

Hi,

The Software Simulator simulates the program flow and execution of instruction lines, but it cannot fully emulate device behavior, i.e. it doesn’t update timers, interrupt flags, etc.

So if your code is hardware dependent you may consider using a hardware debugger instead.

Regards,
Filip.

Post Reply

Return to “mikroC PRO for PIC General”