2021-01-22 05:34 AM
2021-01-22 05:38 AM
I don't really understand the question
(36000000 / 3600) / 1000 = 10 ?
Prescaler = 3600-1
Period = 1000-1
Duty = 500
2021-01-23 04:51 AM
Hi.
Sorry, the question was not so clear.
From PA15 on my card i want to generate a 50Hz 20ms PWM signal. I set it up using STM32CubeIDE.
HCLK = 36MHz. And i have calculated using this formula:
Fpwm = Fclk / (ARR+1)(PSC+1) ==> 50Hz = 36*10^6 / (65535+1)(PSC+1) ==> PSC = 10
If i then set Prescaler = 10-1, Period = 1000-1 and Duty = 500
According to your calculation that will give me (36*10^6/10) / 1000 = 3600 Hz and not the 50Hz i wanted?
2021-01-23 04:56 PM
This is the drawback of using "libraries" and clicking environment, they use different terminology than the Reference Manual, causing confusion.
ARR is the register into which goes parameter you call Period.
JW