PIC32 simulator will execute about 1 million instructions per second on most PCs. The wait times in the data file are not real time they are simulated time. This means you can't just look at the clock on the wall to measure simulated time. Take a look at the stopwatch within MPLAB to see how many cycles are going by between reception of characters to see if the simulator is actually waiting the appropriate number of cycles between characters.
What is your Fosc value in the project settings under simulator tab? Default is 1MHz. In which case I would expect a 10s delay to be about 10 seconds of real time. But if you bumped it down to say 32 kHz (a popular power saving speed) then I would expect 10 seconds of simulated time to be about 1/3 of a second real time.
I have done a quick search in the help contents of MPLAB X and the only reference that I could find related to wait times and the stimulus is in the section titled Message-Based Data File Description
. In that section (which I used as reference to write the stimulus file), it states that the unit of time to be waited can be specified as either ps, ns, us, ms, sec, min
. Does this then apply to a different use case of the stimulus (or other MPLAB X feature) than my use case? If this is not the case, then it seems that the help documentation in MPLAB X is incorrect or incomplete.
Nevertheless, the oscillator setting in the simulator tab (Fcyc in my case) is indeed 1 MHz. Could you kindly explain how you calculate the simulated vs. real time delays for the two clock speeds that you mentioned (in the case of using the simulator)? I would like to properly understand how to calculate this so that I can accurately simulate time delays as per my testing requirements.
It seems that the stopwatch feature is not available for the device that I am using (actually PIC32MX in general, it seems) when using the simulator. Also, when I specify Real ICE as the debugging tool, the stopwatch feature is now available, but the stimulus feature is then not available. Therefore, I could not use the stopwatch to determine the actual time the stimulus waits between sending the packets. UPDATE:
As another test, I have even changed the delays in my stimulus files from a few seconds to over 3 hours between sending the packets, and this seems to have no difference at all. So there is either something very wrong or I am missing something very obvious...
post edited by wave.jaco - 2018/06/27 23:42:05