Nov 02, 2020
11:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 02, 2020
11:28 AM
My timer ticks is a 1KHz rate.
I need a 32 bit timer running at 10KHz rate for run time stats. 10x Tick rate is recommended.
What timers to use?
Any example code?
I'm using Dave 4. XMC4700.
I need a 32 bit timer running at 10KHz rate for run time stats. 10x Tick rate is recommended.
What timers to use?
Any example code?
I'm using Dave 4. XMC4700.
- Tags:
- IFX
4 Replies
Nov 03, 2020
11:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 03, 2020
11:29 PM
Hi,
See the TIMER_EXAMPLE_XMC45 as a reference. It can be easily ported to XMC4700.
It will use a CCU4 or CCU8 slice to implement the timer.
Regards,
Jesus
See the TIMER_EXAMPLE_XMC45 as a reference. It can be easily ported to XMC4700.
It will use a CCU4 or CCU8 slice to implement the timer.
Regards,
Jesus
Nov 04, 2020
09:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 04, 2020
09:42 AM
Thanks Jesus.
But FreeRTOS needs a 32 bit free run counter, counting at 10kHz rate.
And to be able to read the counter value quickly and atomically.
I have looked at the DAVE Timer app, but its not explained well how it works.
There is the TIMER_GetTime() function that returns a 32 bit value.
But its not clear to me what exactly it returns. It seems to imply 1 microsecond resolution. And not sure what to set Time Interval too.
Do I set Time Interval to 2^32 / 100?
But FreeRTOS needs a 32 bit free run counter, counting at 10kHz rate.
And to be able to read the counter value quickly and atomically.
I have looked at the DAVE Timer app, but its not explained well how it works.
There is the TIMER_GetTime() function that returns a 32 bit value.
But its not clear to me what exactly it returns. It seems to imply 1 microsecond resolution. And not sure what to set Time Interval too.
Do I set Time Interval to 2^32 / 100?
Nov 05, 2020
11:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 05, 2020
11:55 PM
Hi,
You can concatenate two CCU4 slices to get a 32bit timer. See XMCLib example\XMCLib\examples\XMC4800_series\CCU4\CCU4_TIMER_CONCATENATION
Regards,
Jesus
You can concatenate two CCU4 slices to get a 32bit timer. See XMCLib example
Regards,
Jesus
Nov 12, 2020
07:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 12, 2020
07:59 AM
I've got it working. But .. I'm not sure I fully believe the numbers.
I used a Timer APP that triggers an interrupt. In the ISR/Handler I increment the Global variable "g_stat_timer_ticks++;" FreeRTOS App is then happy.
My Tick rate is 1000Hz, my Timer rate is 10x, 10KHz.
But, I suspect my Timer is too slow as some tasks report low utilization (<1%).
I used a Timer APP that triggers an interrupt. In the ISR/Handler I increment the Global variable "g_stat_timer_ticks++;" FreeRTOS App is then happy.
My Tick rate is 1000Hz, my Timer rate is 10x, 10KHz.
But, I suspect my Timer is too slow as some tasks report low utilization (<1%).