Since I set Counter Period 9999 for PWM, I can change Pulse from 0 to 9999. 0 being 0% and 9999 being 100% pulse width. __HAL_TIM_SET_COMPARE() is a macro to set the pulse on the fly. For the servo motor, I need 50 Hz signal Clock frequency = 8 000 000 Hz If I divide by Prescalor 16 Frequency = 8000000/16 = 500000Hz If I divide again by Counter period 10000 Frequency = 500000/10000 = 50Hz If it is 50Hz, The full pulse with time is = 1/50 seconds = 20 milli seconds For the servo motor, I need to change the pulse from 0.5 ms to 2.5ms Full 100% pulse is 10000 according to counter period 10000 0 → 0 20 milli seconds → 10000 So, 0.5 milli seconds → 250 and 2.5 milli seconds → 1250 So I can set __HAL_TIM_SET_COMPARE() from 250 to 1250
is it possible to power the mcu from st link debugger? because i tried the code and the servo twitches only but works great on proteus simulation! Thanks
I have the same problem, I'm working with the SG92R, and I cannot do it work with anything. I've tried use an external power source, but the problem still there
Do RC4522 separately and make sure it works Do servo motor separately and make sure it works Do servo motor separately with 72MHz clock, set TIM2 Prescaler set to 143 (Instead of 15) and make sure it works Combine together :)
Hello Sir, I need you to ask a question. Can I send it to your e-mail address? I need to explain it well in order to be easier to understand by you. Is it possible? My question involves servo motor usage that's why I commented down here. Thanks...