I need a high precision interrupt for my STM32F7. The task is to increase a counter at every tick. The frequency of the CPU is up to 216 MHz (from datasheet) which means an tick duration of around 5 ns can be achieved right?
After some internet research I found out that sysTick can be used for this purpose. I should simply configure the SysTick as follows:
/** Configure the Systick interrupt time */
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
/**Configure the Systick */
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
I'm toggling a GPIO pin inside the SysTick_Handler function to check the frequency of execution and it is 1 ms.
I want to achieve a tick duration of 1 microsecond so I replaced the 1000 (in the code) with 100, then I tried different numbers but nothing seems to affect the 1 ms duration.
Am I missing something here? Is there a better solution than the sysTick to achieve this goal?
Thanks.