Skip to main content
Visitor II
July 26, 2024
Question

TIMER and GPIO PIN

  • July 26, 2024
  • 2 replies
  • 776 views

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

 

    This topic has been closed for replies.

    2 replies

    Super User
    July 26, 2024

    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

    Super User
    July 26, 2024

    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 .