AnsweredAssumed Answered

about the cycle count in BF518

Question asked by dcba001 on Nov 11, 2011
Latest reply on Nov 14, 2011 by CraigG

Hi,Guys,

    Here I need a cycle count function in BF518 code for realtime alarm, instead of Emulator environment.

I used the clock() as mentioned in EE-332:

 

#include <time.h>
...........................

volatile clock_t clock_start;
volatile clock_t clock_stop;
........................
clock_start = clock();

Some_Function_Or_Code_To_Measure();
clock_stop = clock();

cycle_count=clock_stop –clock_start;

......................................

 

if(cycle_count>Upper_Limit)

Alarm();

.....................................

 

 

Check with you that, if this is feasible and stable in real time code execution.

 

By the way, from all the Q&A in EZ, I could not find anyone used this clock() function, who mostly used

START_CYCLE_COUNT(start_count);
and
STOP_CYCLE_COUNT(final_count,start_count);

 

Thank you.

Outcomes