How to measure the clock cycles to run a program.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to measure the clock cycles to run a program.

1,036 次查看
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 项奖励
回复
2 回复数

880 次查看
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 项奖励
回复

880 次查看
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 项奖励
回复