How to measure the clock cycles to run a program.

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

How to measure the clock cycles to run a program.

546 Views
patricio
Contributor IV

Hello all,

I use a FRDM-KL25Z board and CodeWarrior 10.5.

I am working with the ADC in the continuos mode and the analog to digital complete interrupt is enabled. I would like to know how to measure the number of cycles that takes it from the ADC conversion is finished until the interrupt sub-routine is executed.

I am exploring the CoderWarrior debugger but I am not able to find out the solution. I run the program step by step by the debugger but I can´t find the solution to measure the cycles.

Any help will be appreciated.

Thank you in advance.

0 Kudos
2 Replies

390 Views
Stano
NXP Employee
NXP Employee

Hello Aitor,

the best way how to know the number of cycles for the conversion is to calculate it from the datasheet information on section 28.3.3. The number of cycles depends on the actual setting of the ADC module, so need take it into account. It depends on the MODE selection in CFG1 reg and ADLSTS in CFG2 reg also.

I suppose this helps you.

Best Regards,

Stano.

0 Kudos

390 Views
patricio
Contributor IV

Hello Stano,

Thank you for your reply but I am afraid the conversion time is not what I am looking for. I would like to measure the time between the conversion is finished until the interrupt routine is executed

Thank you.

BR.

Aitor.

0 Kudos