Not applicable

# TIMER Version 4.1.10 , Resolution with Dave 4.3, XMC4500

Hello,

im using the TIMER APP in Dave 4.3 with an XMC4500.
Is there any way to calculate the actual Resolution of the TIMER?

thanks
Lukas
3 Replies
Employee
Employee

# Re: TIMER Version 4.1.10 , Resolution with Dave 4.3, XMC4500

HI Lukas,

so to explain the logic behind the algorithm I will use this code section that is part of TIMER.manifest (files they generate code for the APPs). You can find this file under "/Dave/Model/APPS/TIMER/v4_1_10/TIMER.manifest".

`   /*   * Based on the input clock frequency and input time interval least possible prescaler is calculated. So that error is less.   * This value is used during code generation in templates.   */                          timer_prescaler.value = MF({Integer prescaler = 0	                                          Double Clock_Period_min = 0					          Double Clock_Period_max = 0				                  for(prescaler = 0; prescaler <= prescaler_maxvalue; prescaler++)					          {						      Clock_Period_min = timer_resolution(timer_clock_mhz.value,prescaler);  /* convert to usec */						      Clock_Period_max = Clock_Period_min * period_16bit_maxvalue;  /* convert to usec */									  						       if(gfloat_time_interval.value <= Clock_Period_max)	                                               break;						   }`

As you can see, the algorithm tries to find the least possible prescaler value with which is possible generate wished time interval. Prescaler value is just something that divides frequency clock so for example; XMC4500 has clock frequency of 120 MHz, meaning that the finest achievable frequency is 1/120 MHz or 8.33ns. If you multiply that value with maximum 16 bit value (while the period register in TIMER is 16 bit wide), then you get possibility of generating time interval in this range [8.33 ns - 0.546 ms]. And if your desired time interval is for example, 10 ms, you can see that wished interval cannot be generated with such a resolution, so TIMER APP will try to find next suitable prescaler value. If you want more control over resolution value that should be used then I suggest that you take a look at CCU4/CCU8_SLICE_CONFIG APPs where you can immediately see which resolution will be used. But as I said, it´s fairly easy to calcute it in this case too.

Best regards,
Deni
Not applicable

# Re: TIMER Version 4.1.10 , Resolution with Dave 4.3, XMC4500

Hi Deni,

thanks for the explanation, but where do i find CCU4/CCU8_SLICE_CONFIG APPs?

Best reards,
Lukas
Employee
Employee

Hi Lukas,