Skip to main content
Associate II
May 3, 2024
Question

timer calculation and clock configuration setting in mxcube

  • May 3, 2024
  • 1 reply
  • 1230 views

i am using stm32h735g-dk board,trying to interface servo motor with it by using timer5 channel1.please give me step by step explination to set prescalar and arr value

This topic has been closed for replies.

1 reply

AScha.3
Super User
May 3, 2024

What is the "servo motor" ?

show pic.

What signal it needs ? (frequ., pulse timing ...)

"If you feel a post has answered your question, please click ""Accept as Solution""."
dee1Author
Associate II
May 3, 2024

motor name is MG90.for every 1sec im trying to run it so how to configure clock for this

sysclock delay also not working.

AScha.3
Super User
May 3, 2024

Ok, this :

AScha3_0-1714740738339.pngAScha3_1-1714742281466.png

So set TIM5 ch1 : i have clock -> timers 200MHz, so div 199 -> 1us timer tick ; 

AScha3_3-1714743906341.png

AScha3_2-1714743678282.png

ccr 1500 -> mid position ; set to 1000...2000 for full left/right position.

then in main:

 HAL_TIM_PWM_Start(&htim5, TIM_CHANNEL_1);
"If you feel a post has answered your question, please click ""Accept as Solution""."