How to measure clock cycles/ timing in true time simulator/ Real-time debugger between breakpoints

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

How to measure clock cycles/ timing in true time simulator/ Real-time debugger between breakpoints

Jump to solution
1,120 Views
ramakr02
Contributor III

Dear All,

Following are the details of the hardware used:

1. Development board: EVB9S12XF512E (S12XFSTARTERKITE: S12XF 2-Node Starter Kit)

2. Target Processor: MC9S12XF512MLM

3. IDE: CodeWarrior Classic HCS12(X) 5.2 (Added the missing derivatives)

I was wondering if there is any debugger option or tool within true time simulator/ Real-time debugger to count or measure clock cycles (or time) elapsed between a breakpoint or start and stop of program on-board?

Any help is welcome!   @dianabatrlova , @RadekS 

Thank you.

Best regards,

Rohit

0 Kudos
1 Solution
1,107 Views
RadekS
NXP Employee
NXP Employee

Hi ramakr02,

You may switch hiwave into Full Chip Simulation (menu-Component-Set Connection). 
The Register window will show clock cycles. You may switch to the time axis (in ms) by click on the clock value at the Status bar. This tool is good mainly for testing limited code snippets due to a lack of interrupts.

Unfortunately, no clock counter directly in CPU which may be used in run-time debugging on MCU. You may configure and use TCNT register for measuring time periods. However, we typically use an Oscilloscope or Logic Analyzer together with GPIO pin toggling for time measurement.

The GPIO pin toggling presents minimum code intervention and known self-compensated delay for port write.  

I hope it helps you.

Best regards

Radek

 

View solution in original post

0 Kudos
2 Replies
1,108 Views
RadekS
NXP Employee
NXP Employee

Hi ramakr02,

You may switch hiwave into Full Chip Simulation (menu-Component-Set Connection). 
The Register window will show clock cycles. You may switch to the time axis (in ms) by click on the clock value at the Status bar. This tool is good mainly for testing limited code snippets due to a lack of interrupts.

Unfortunately, no clock counter directly in CPU which may be used in run-time debugging on MCU. You may configure and use TCNT register for measuring time periods. However, we typically use an Oscilloscope or Logic Analyzer together with GPIO pin toggling for time measurement.

The GPIO pin toggling presents minimum code intervention and known self-compensated delay for port write.  

I hope it helps you.

Best regards

Radek

 

0 Kudos
1,105 Views
ramakr02
Contributor III

Thank you @RadekS .

 

I've configured PIT1 for 20usec period, just wanted to confirm that period in debugger. Oscilloscope is an option. 

 

Also, I think the flexray module on chip, is not halted when true time simulator is paused. Is that true?  

 

Best regards,

Rohit

0 Kudos