How to generate a delay function with a 1 micro second resolution, without affecting the existing HAL_Delay 1 millisecond resolution function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-12-09 8:35 PM
I'm using a STM32F429ZI Nucleo-144, and need a counter/delay function with 1 microsecond resolution, but want to keep the HAL_Delay function at 1 millisecond resolution for other uses.
I'm looking at potentially reconfiguring the SysTick interrupt to 1 microsecond by modifying the call to HAL_SYSTICK_Config, using HAL_SYSTICK_Callback to create a counter with 1 microsecond resolution, and then overloading the weak HAL_Delay function to take the faster SysTick into account and keep it at 1 ms. But HAL_SYSTICK_Config is called from SystemClock_Config which is code generated by STM32Core, so it will be overwritten next time I regenerate the project. Is there a better way to obtain a counter/delay with 1 microsecond resolution?
