cancel
Showing results for 
Search instead for 
Did you mean: 

Why i didn't get 50hz frequency when i set internal clock(APB1 Timer clock) is 20mhz?

MSree.1
Associate

Board: STM32L496ZG

My requirement - 2ms dead time

Frequency - 50hz and Internal clock is 40mhz.

In 40mhz (internal clock) i got expected frequency (50hz) using

Prescaler = 80-1

Peroid value = 10000-1

PWM Counter =5000-1

Then, i reduced my Internal clock has (20mhz) same expected frequency (50hz) using

Prescaler = 40-1

Peroid value = 10000-1

PWM Counter =5000-1 instead of 50hz i got 100hz

Except 20mhz if i set (2.5mhz) and (0.625mhz) i got same expected frequency.

(Why its happening if i set 20mhz?)

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3

> Then, i reduced my Internal clock has (20mhz)

How exactly? By setting APB prescaler to 2?

JW

System clock = 80mhz

HCLK = 40mhz

APB1 Prescaler = 2

0693W00000Y7OXdQAN.pngJW