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

Help with timer LPC2106

Hello,

I am using an LPC2106 CPU running at a speed of 10MHz, I would use a timer that counts in periods of 1 microseconds just as the system clock without interruption. I can check the system's a good time when I use a period of 1 millisecond but with 1 microseconds the error is very big, around 40%. Can anyone help me with that?

Best Regards,

Bruno
CIn/UFPE Brazil

Parents
  • Ok,

    I am still not using a real hardware to perform the measurements. I am using the debugger Keil and comparing the time of IDE with the timer counter. With regard error i saw the following: when the TIMER0 in the window of peripheral is 10 microseconds the program time count of 14 microseconds.

    Changed the preescaler so that the tick was from 1 millisecond and when the counter of TIMER0 was on 10 miligundos in the program time of IDE also read a count of 10 milliseconds.

    Thank you.

    Bruno,

Reply
  • Ok,

    I am still not using a real hardware to perform the measurements. I am using the debugger Keil and comparing the time of IDE with the timer counter. With regard error i saw the following: when the TIMER0 in the window of peripheral is 10 microseconds the program time count of 14 microseconds.

    Changed the preescaler so that the tick was from 1 millisecond and when the counter of TIMER0 was on 10 miligundos in the program time of IDE also read a count of 10 milliseconds.

    Thank you.

    Bruno,

Children
  • Note that the simulator will not be 100% clock-for-clock exact. The main task of the simulator is to compute identical results as the real processor. Being clock-for-clock correct may affect the simulation times a lot since then the simulator must not only produce the same end results, but must perform a large number of micro-steps or internal logic operations.

    And another thing. The simulator doesn't even know all wait states in the real memory or all hidden extra logic in the internal processor busses of the processor.

    Use the simulator estimations to get an approximation of number of clock cycles to run a code block. But don't rely on the information as perfect.

  • Per Westermark,

    Thanks for your attention.

    Best regards.