cancel
Showing results for 
Search instead for 
Did you mean: 

TIMER and GPIO PIN

Nakata
Associate II

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?

Nakata_2-1722018201849.png

Nakata_0-1722018043049.png

Nakata_1-1722018123342.png

 

2 REPLIES 2
TDK
Guru

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

If you feel a post has answered your question, please click "Accept as Solution".
AScha.3
Chief III

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 .

If you feel a post has answered your question, please click "Accept as Solution".