cancel
Showing results for 
Search instead for 
Did you mean: 

Chronometer

jean-claude
Associate II
Posted on July 03, 2009 at 10:23

Chronometer

4 REPLIES 4
jean-claude
Associate II
Posted on May 17, 2011 at 13:16

Hi,

I want to measure the execution time of a function.

I want make something like that:

int main(){

start Timer1;

/*---

Measured function(s);

---*/

t = TIMER1_CNT;

}

Someone knows the solution witch takes the less space of ROM ?

Have a good day.

jean-claude
Associate II
Posted on May 17, 2011 at 13:16

I don't find the good functions,

I try:

{

#include ''stm32f1Ox_lib.h''

#include ''stm32f1Ox_conf.h''

TIM1_SetCounter();

t=TIM1_GetCounter();

}

but build is failed becaude of File truncated ???

I don't see how to use a TIMER, and why the file is truncated.

Normally, when the Timer start this is the register TIME1_CNT which stock the value ?

briand.myers9
Associate II
Posted on May 17, 2011 at 13:16

Move your #include lines outside of your function, and keep on studying. Good luck!

jean-claude
Associate II
Posted on May 17, 2011 at 13:16

Hi,

I re-ask my question :

1) What is the command to put 0x01 in the Control_Register_1 of Timer1 without use functions ?

2) Counter (CNT), TIM_CNT is the register where the value of the number of clock hits, is stocked ? It always up afeter enable counter ?

Thanks.