Function | Functional Macro | number |
|---|---|---|
Counter value-> Microsecond conversion | TIM_FRT_CNT_TO_MCR | 15 |
microseconds-> counter value conversion | TIM_FRT_MCR_TO_CNT | 16 |
Function | Functional Macro | number |
|---|---|---|
FRT initialization | TIM_FRT_INIT | 8 |
How to get elapsed time
The following functions are provided for obtaining elapsed time.
Function | Functional Macro | number |
|---|---|---|
Counter value setting (16 bits) | TIM_FRT_SET_16 | 9 |
Counter value acquisition (16 bits) | TIM_FRT_GET_16 | 10 |
void sysInit()
{
TIM_FRT_INIT (8); / * Set frequency division to 8 * /
...
}
void writeFrameBuff()
{
Uint16 count; / * Acquisition count value storage area * /
float micro_sec; / * Microsecond storage area * /
TIM_FRT_SET_16 (0); / * Set the count value to 0 * /
WriteAllVram (); / * Process execution you want to measure * /
count = TIM_Frt_Get_16 (); / * Get the count value * /
/ * count indicates the execution time of WriteAllVram () * /
micro_sec = TIM_FRT_CNT_TO_MCR (count); / * Convert counter value to microsecond * /
printDisplay (micro_sec); / * Display elapsed time on the screen * /
}