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

Accuracy of Keil Simulation time

Im using LPC1778 uC to generate a pulse of 500Hz from the timer interrupt routine.
I have configured the interrupt to interrupt every 200uS.
It enters the ISR on time.
But what i want to know is the accuracy of the keil simulation time shown?
Will it vary when actually executed on the hardware.Because the Logic analyser shows a pulse that slightly off than whats expected.
How reliable is the logic analyser graph,which depends on the keil sim time shown?

Parents
  • The actual instruction timing may be off, because it is hard to emulate the exact number of wait states introduced in the processor pipeline for different memory access situations.

    But the timer itself should tick at the correct speed, if you have configured the simulator to use the correct virtual crystal - if your source code sets up the timer for one crystal frequency while the simulator things you are emulting using a different crystal frequency then you would get lots of errors.

    Have you made sure you don't have the traditional off-by-one error that lots of people manage when programming NXP chips, because they do not actually read the full information in the datasheet?

    So to divide from 12MHz into 1ms you shouldn't divide by 12000 but with 12000-1.

Reply
  • The actual instruction timing may be off, because it is hard to emulate the exact number of wait states introduced in the processor pipeline for different memory access situations.

    But the timer itself should tick at the correct speed, if you have configured the simulator to use the correct virtual crystal - if your source code sets up the timer for one crystal frequency while the simulator things you are emulting using a different crystal frequency then you would get lots of errors.

    Have you made sure you don't have the traditional off-by-one error that lots of people manage when programming NXP chips, because they do not actually read the full information in the datasheet?

    So to divide from 12MHz into 1ms you shouldn't divide by 12000 but with 12000-1.

Children