internal clock

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
trilu
Posts: 2
Joined: Wed Oct 28, 2020 12:23 pm

internal clock

Post by trilu »

Dear all,

i have some experiance in developing home automation stuff based on homematic and atmel cpu's as the 328.
Due to their limitation i am trying to use the stm32f103rct cpu, mainly because of their additional flash, but also because of the 16bit PWM.

For now i am wondering how i can use the cpu without an external clock signal. I've seen in the datasheet that the CPU has an internal 8MHz clock and an 40kHz clock for the RTC as well. I've seen as well that the cpu boots on its internal clock, but i cannot find any hind how i can tell it to stay on teh internal clock.

Please be patient with me if I missed something...
Best regards
trilu
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: internal clock

Post by fpiSTM »

The internal clock are called HSI and LSI.
You can simply define your own clock config as the default one is a weak:
https://github.com/stm32duino/Arduino_C ... t.cpp#L114

To do this, in you sketch define your own one, you can use STM32CubeMX to generate it and don't forget the extern "C":

Code: Select all

extern "C" void SystemClock_Config(void)
{
...
}
Post Reply

Return to “General discussion”