Understanding System Timer
Posted: Thu Dec 03, 2020 3:40 pm
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.
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.