This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Measuring time between two received bytes on UART in debug script

I can see how to receive bytes from the simulated MCU in a script, but I only see "seconds" variable for execution time, which is not good for me. Is it possible to measure milliseconds?

Using SIGNAL might be a solution, but I worry that running a signal function every 1ms (to update a global variable used in the uart rx handler to check the byte gap timing) will be too resource heavy on the PC.

Parents
  • Hi,

    if you need something like a stop watch, you can reset t1 (right bottom of uV Window) to zero and then measure a part of your program.

    If that is not accorate enough for you, you could calculate the cycles difference (can be found in the Register Window) and then - with the CPU Frequency - calculate the time from that.

    BR,
    /th.

Reply
  • Hi,

    if you need something like a stop watch, you can reset t1 (right bottom of uV Window) to zero and then measure a part of your program.

    If that is not accorate enough for you, you could calculate the cycles difference (can be found in the Register Window) and then - with the CPU Frequency - calculate the time from that.

    BR,
    /th.

Children