|
|
Component
FreeCntr8
Time measurement counting periodic interrupt ticks in 8-bit SW counter (suitable for longer time periods).
Component Level: High
Category:
CPU Internal Peripherals-Timer
Typical Usage:
(Examples of a typical usage of the component in user code.
For more information please
see the page Component Code
Typical Usage.)
Required component name is "FC81".
(1)
MAIN.C
void main(void)
{
unsigned int i, time;
float one_loop_us;
FC81_Reset(); /* reset the counter */
for (i = 0; i < 60000; ++i); /* for-cycle */
/* get measured time of whole for-cycle */
if(FC81_GetTimeUS(&time) == ERR_OK) {
/* average time of one loop */
one_loop_us = time / 60000.0;
}
}
|