TIMER 4.1.6 with DAVE 4.1.4 and XMC4500 Step AB - Possible Bug

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User5581
Level 3
Level 3
Using the DAVE4 Timer app, I configured a CCU4 slice to have a period of 50 microseconds in the App GUI:
1625.attach
Its event is connected to an interrupt in which I toggle a GPIO line high and low. When I execute the code I can
see with an oscilloscope that the interrupt arrives with a period of 50 us, just as I requested. This much works nicely.

However, If I then examine that timer's TIMER struct instance at runtime, I find that the .time_interval_value_us field
of the structure has been set to 5000. The trailing '_us' in the field name leads me to believe that the value stored in this
field has units of microseconds, but it actually has a unit value of 10ns.

A text search through the project finds the following line in timer_confc.tmpl:
  .time_interval_value_us = ${((appIns.gfloat_time_interval.value * 100)).toLong()}U,

Here it appears that the GUI code is deliberately multiplying the user entered value in microseconds by 100.

There appears to be an inconsistency here. Either the units label on the form is incorrect, or the suffix of the TIMER struct
field name is incorrect. Other code that I wrote that assumes units of this field to be in microseconds becomes incorrect in this case.
Which is meant to be right? Or, are they both meant to have units of microseconds, and the factor of 100 in the GUI code is wrong.

Please advise regarding the intended behavior, and please add it to the bug fix list if it is a bug. I will code around this for now.

Best Regards,
Kurt J.
0 Likes
3 Replies
Not applicable
Hi Kurt,

The scaling by a factor of 100 is intended for the APP as the APP is intended to be used on XMC4000 and XMC1000 device. On the XMC1000 device, this represents a fixed-point implementation of the timer calculation. (i.e. in the UI if the entry is 21.34us, the value in the configuration is 2134)
In this way, this has allowed a better resolution of the timer to be implemented as it is supported by the CCU hardware.

Let me know if this is clear for you. If you think that this is still misleading, I can file an e-Ticket to emphasis the "scaling factor of 100" in the APP documentation.
Please let me know your thoughts on this.

Regards,
Daryl
0 Likes
User5581
Level 3
Level 3
Hi Daryl,

If the intent of the TIMER app authors is that the unit values of these variables is 10ns, I would recommend that the App
documentation make this clear. I would also suggest that the misleading '_us' suffix on the variable names implying units
of microseconds be removed.

I appreciate the opportunity to give my feedback. Thanks!

-Kurt
0 Likes
Not applicable
Hi Kurt,

Thanks for the feedback. We appreciate your feedback too! 🙂

I have filed the e-Ticket (#173084162) as requested.

Regards,
Daryl
0 Likes