I'm trying to understand the system timer, specifically how to set the frequency. I'm working on a STM32F7. As Giovanni explained in this thread:
viewtopic.php?t=4995#p34767 must be a multiple of a 16 bit prescaler.
The F7 works with a 108Mhz prescaler (at least by default that is), so setting 10000 should not work (as used as an example above). However exactly the used as a default value for the F7 in the https://github.com/ChibiOS/ChibiOS/blob/master/demos/STM32/RT-STM32F767ZI-NUCLEO144/cfg/chconf.h#L55 demo repo, I've been using the default value for some time now. How does that work?
I have a thread that gets called every 64us and want to measure that with the systick. Easiest way is to just make it faster.
What are the disadvantages for turning up the CH_CFG_ST_FREQUENCY value by 10x for example?
Also: Is there an easy way to convert the SYSTICK to nanoseconds? I tried to adapt the uc version but with no success so far.
Understanding System Timer
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Understanding System Timer
JSStabl wrote: have a thread that gets called every 64us and want to measure that with the systick. Easiest way is to just make it faster.
What are the disadvantages for turning up the CH_CFG_ST_FREQUENCY value by 10x for example?
Yes, it is possible but then you have to play with the delta parameter and it can be tricky, basically you need to increase it until it works stably.
JSStabl wrote:Also: Is there an easy way to convert the SYSTICK to nanoseconds? I tried to adapt the uc version but with no success so far.
No there are only conversion macros for seconds, milliseconds and microseconds. You should be able to do a conversion macro yourself, using the microseconds one as example.
Giovanni
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Understanding System Timer
Hi,
Just run the test suite, have you also increased the delta parameter?
Giovanni
Just run the test suite, have you also increased the delta parameter?
Giovanni
Who is online
Users browsing this forum: No registered users and 55 guests