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 execution time

I want to evaluate time of function execution in simulator. This function (void abc() for example) is called from external interrupt routine. I have done some tests and got different results:

1 test: On chip. After interrupt occurs, I write 1 to pin, then abc(), and write 0 to pin. So, I can use oscillograph to see real execution time of abc() between pin statement changing. It is about 400mks.

2 test: In Simulator. I wrote endless loop (while(1)) with abc() routine and made measurement with Perfomance Analyzer. It is 470 mks.

3 test: In Simulator. It repeats first test, but i look for time in Register window(Sec) between two breakpoints (before and after abc()). It is about 100 mks.

Processor XC167CI with 32 MHz clock.
Why so different results in measuring?

Parents
  • Well, if 'u' is "micro", then 'U' must stand for "macro". Macro resistance to the right -- but he says nothing about resistance to the left, so I suppose there is none. Must be talking about a diode on the board.

    I'm puzzled as to what happens when you turn the board over, though, swapping left for right. I'm not familiar with any diodes that can maintain an absolute spatial orientation. Could be handy for building products that only work during the day or during the night, though.

Reply
  • Well, if 'u' is "micro", then 'U' must stand for "macro". Macro resistance to the right -- but he says nothing about resistance to the left, so I suppose there is none. Must be talking about a diode on the board.

    I'm puzzled as to what happens when you turn the board over, though, swapping left for right. I'm not familiar with any diodes that can maintain an absolute spatial orientation. Could be handy for building products that only work during the day or during the night, though.

Children