cancel
Showing results for 
Search instead for 
Did you mean: 

Hi. I have a STM32F3Discovery card. I use STM32CubeIDE. Clock 36MHz, Prescale 3600, Counter Period 1000 and **** 500. How come that i get a 10Hz, 3.14V and 100ms signal on my oscilloscope?

MHelg.1
Associate II
 
3 REPLIES 3

I don't really understand the question

(36000000 / 3600) / 1000 = 10 ?

Prescaler = 3600-1

Period = 1000-1

Duty = 500

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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?

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