STM32F4 Timer Period Discrepancy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 10:11 AM
I am setting up Timer 1 channel 3 on the STM32F4. I am looking to set up a period of 3.9ms or 256kHz. I am using ABP1 - 168kHz, the ARR is set to 65535, and a prescaler of 10.
65535 / ( 168,000,000 / 10) = 3.9ms
My timer initialization is below.
This scope captures the signal at a 50% duty cycle and the configuration shown above. I am quite lost on why this is happening.
Solved! Go to Solution.
- Labels:
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 10:37 AM
The correct equation is:
(ARR+1) / ( 168,000,000 / (prescaler+1) ) = timer period
So with ARR=65535 and prescaler=10 you should get 4.29ms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 10:37 AM
The correct equation is:
(ARR+1) / ( 168,000,000 / (prescaler+1) ) = timer period
So with ARR=65535 and prescaler=10 you should get 4.29ms.
