2024-07-26 11:28 AM
Hello,
I'm have a Nucleo board with a STM32F334R8T6
I configured a timer with 10kHz and I'm using the HAL_TIM_PeriodElapsedCallback to call a funtion that will control my motor and read some data with the ADC. I want to check the frequency that the controller function hapens, my first idea was to toggle a GPIO pin every time the function is called, but the frequency is lower than the 10kHz, aprox 7kHz, anyone knows why this is hapenning?
2024-07-26 01:30 PM
We already told you in your previous post about this issue and pointed you towards resources and examples that can help. If you don't understand something, please reply and engage rather than repost the same issue.
PWM and ADC conflict - STMicroelectronics Community
2024-07-26 01:31 PM - edited 2024-07-26 01:33 PM
Hi,
maybe you do in the callback something, that needs more than 100us ...then it cannot get the 10kHz rate.
Try only toggle the pin, nothing else, to see: now 10kHz ?
If still not at 10k , then check your settings...clock, divider etc. , something wrong .