CPU cycles

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CPU cycles

Jump to solution
2,465 Views
spa
Contributor I
Hello all,
I am using code warrior development environment for HC08 and HC12. When debugging the applications by means of the full chip simulator I can rget a feeling of the execution time by reading the amount of "CPU cycles" needed (in the register window).
By the way, are the "CPU cycles" corresponding to the number of clocks required to run the application or shall I multiply the CPU cycles by a certain factor to get the number of CLOCK CYCLES?
If so, which are these factors for HC08, HCS08, HC12, HCS12?
Thank you very much...
Spa
Labels (1)
Tags (1)
0 Kudos
1 Solution
630 Views
CrasyCat
Specialist III
Hello
 
For HC12, HCS12 you can use the full chip simulator to get an idea of the execution time for a function or a portion of a function.
I would do it as follows:
  - Set a breakpoint at the beginning of the function.
  - run to that function
  - In the status bar (on the bottom of HI-WAVE window, double click on the cycle count. This will
    set the cycle count in the status bar to 0.
  - Point to the end of the function (or end of sequence you want to measure), click with right mouse button
    and select "Run to Cursor"
  - When application is stopped, you see the number of cycle needed to reach that instruction in the
    status bar.
Number of cycle there are number of CPU Cycles.
 
Note that for HC08 you cannot use the status bar:smileysad:.
You have to enable trace in the Trace component to get cycle counts.
 
CrasyCat

View solution in original post

0 Kudos
3 Replies
631 Views
CrasyCat
Specialist III
Hello
 
For HC12, HCS12 you can use the full chip simulator to get an idea of the execution time for a function or a portion of a function.
I would do it as follows:
  - Set a breakpoint at the beginning of the function.
  - run to that function
  - In the status bar (on the bottom of HI-WAVE window, double click on the cycle count. This will
    set the cycle count in the status bar to 0.
  - Point to the end of the function (or end of sequence you want to measure), click with right mouse button
    and select "Run to Cursor"
  - When application is stopped, you see the number of cycle needed to reach that instruction in the
    status bar.
Number of cycle there are number of CPU Cycles.
 
Note that for HC08 you cannot use the status bar:smileysad:.
You have to enable trace in the Trace component to get cycle counts.
 
CrasyCat
0 Kudos
630 Views
spa
Contributor I
Hello,
thanks for your feedback! Do you also know how many clock cycles correspond to 1 CPU cycle for HC08, S08, RS08, HC12, HCS12?
Many thanks
Spa
0 Kudos
630 Views
CrasyCat
Specialist III
Hello
 
What do you mean with clock cycle? Do you mean bus cycles, oscillator cycles?
In any case, the conversion between CPU cycles and bus or oscillator cycles depends on your configuration (oscillator frequency, PPL settings, ....).
 
CrasyCat
0 Kudos