2019-03-29 11:37 AM
Hi,
I am going to use internal osc for generating a frequency of signal 36khz.
Solved! Go to Solution.
2019-03-29 12:39 PM
Which STM32 is being used?
Most of the time it's a question of clock tolerances which is the real parameter to look after.
2019-03-29 12:39 PM
Which STM32 is being used?
Most of the time it's a question of clock tolerances which is the real parameter to look after.
2019-03-29 12:49 PM
STM32F030F4P6
2019-03-29 12:50 PM
APB timer is being used
2019-03-29 01:04 PM
All this stuff is basic division. You have integer dividers, and you may or may not need a prescaler depending on how low the frequencies are.
The Prescaler and Period settings on the F0 will all be limited to 16-bit
CLOCKOUT = (CLOCKIN / Q) / P
Where
Prescaler = Q - 1
Period = P - 1
To get 36 KHz, you'd probably want to use 9 MHz rather than 8 MHz
ie 9,000,000 / 36,000 = 250 <- an integer
Prescaler = 0, Period = 249
2019-03-29 01:50 PM
8'000'000 : 36'000 = 2000 : 9
Your MCU allows / 2 * 9 to get 36 MHz and then / 1000 in timer to get 36 kHz. But if it's remote IR protocol, then it doesn't need such an exact frequency. For example You can run MCU at 48 MHz and do / 1333 in timer to get 36'009 Hz frequency, which is more than enough precise.