infineon4engi@twitter twitter

infineon4engineers Facebook

infineon@linkedin linkedin

infineon@youtube youtube


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    New Member New Member Lukas123 is on a distinguished road
    Join Date
    Oct 2017
    Posts
    4
    Points
    45

    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

  2. #2
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    DRubeša will become famous soon enough
    Join Date
    Jul 2016
    Location
    München
    Posts
    196
    Points
    427.8125
    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".

    Code:
       /*
       * 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
    Last edited by DRubeša; Jan 18th, 2018 at 06:07 AM.
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    New Member New Member Lukas123 is on a distinguished road
    Join Date
    Oct 2017
    Posts
    4
    Points
    45
    Hi Deni,

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

    Best reards,
    Lukas

  4. #4
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    DRubeša will become famous soon enough
    Join Date
    Jul 2016
    Location
    München
    Posts
    196
    Points
    427.8125
    Hi Lukas,

    try under "Add new APP":

    Click image for larger version

Name:	add_new_app.PNG
Views:	0
Size:	9.5 KB
ID:	3331

    And then under "Search filter" start entering text like "CCU" and you can see that in my case both APPs are visible:

    Click image for larger version

Name:	search_filter.PNG
Views:	0
Size:	46.2 KB
ID:	3332

    If those APPs are not listed that could mean they are not installed. So go to "Help"-> "Install DAVE APP/ Example/...".There under "Work with:" select "DAVE APPs Library Manager". And again, under "Enter the keywords to filter" write something like "CCU"...you should see it there. Check also that maybe the fitter "Hide items that are already downloaded" is enabled. But that could just mean you already have downloaded the APP. So yes, you should be able to find it one way or another.

    Best regards,
    Deni
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.