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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-22 5:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-22 5:38 AM
I don't really understand the question
(36000000 / 3600) / 1000 = 10 ?
Prescaler = 3600-1
Period = 1000-1
Duty = 500
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-23 4: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-23 4: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
