Keil™, An ARM® Company

Technical Support

DSCOPE: HIGH RESOLUTION TIMING FOR PROGRAM EXECUTION


Information in this article applies to:

  • C166 Version 3.12
  • C166 Version 4.03
  • C251 Version 2.14
  • C51 Version 5.50

QUESTION

I am using the dScope debugger simulating a chip that runs at 24 MHz. The timing counter in the Register Window only provides 1 uSec resolution. Is there a way to get better resolution for timing my programs?

ANSWER

To get better than 1 uSec resolution in the debugger, you may want to use the cycles variable along with the xtal variable.

  • Cycles returns the number of CPU cycles that have elapsed since the simulator was reset.
  • Xtal returns the crystal speed.

If xtal is set to 12,000,000 (for 12 MHz) and cycles is set to 6,000,000, then half a second has elapsed. To get extremely accurate execution times, divide cycles by xtal.

MORE INFORMATION

Refer to page 90 of the dScope for Windows User's Guide 01.97 for more information about the cycles variable.

Last Reviewed: Tuesday, June 15, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure