Skip to main content
Divyanshu
Associate II
March 29, 2019
Solved

clock frequency calculations

  • March 29, 2019
  • 2 replies
  • 2564 views

Hi,

I am going to use internal osc for generating a frequency of signal 36khz.

  1. Do i need any external circuitry for it ..?
  2. For selection of 8Mhz frequency as clock can it be done in cube mx only and generate a source code form there...?
  3. Selection of prescaler for 8MHZ frequency to get signal of 36khz.

This topic has been closed for replies.
Best answer by S.Ma

Which STM32 is being used?

Most of the time it's a question of clock tolerances which is the real parameter to look after.

2 replies

S.Ma
S.MaAnswer
Principal
March 29, 2019

Which STM32 is being used?

Most of the time it's a question of clock tolerances which is the real parameter to look after.

Divyanshu
DivyanshuAuthor
Associate II
March 29, 2019

STM32F030F4P6

Divyanshu
DivyanshuAuthor
Associate II
March 29, 2019

APB timer is being used

Piranha
Principal III
March 29, 2019

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.