EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: ranganatennakoon on August 15, 2022, 11:15:23 am

Title: about stm32 hardware design
Post by: ranganatennakoon on August 15, 2022, 11:15:23 am
The stm32F103XX needs 2 oscillators. 8MHz is main one and 32KHz for RTC. If I don't use the RTC functions then adding the 32KHz oscillator is not essential right?

thanks
Title: Re: about stm32 hardware design
Post by: gamalot on August 15, 2022, 11:24:19 am
Yes, you are right, in fact both external crystals are optional and the STM32 can run without both of them.
Title: Re: about stm32 hardware design
Post by: JohanH on August 15, 2022, 12:02:33 pm
If you use USB, the internal clock doesn't have good enough tolerance for the USB specification, although it might work in practice, but isn't guaranteed.
Title: Re: about stm32 hardware design
Post by: jordannedev on August 15, 2022, 12:04:28 pm
https://www.st.com/resource/en/application_note/an2586-getting-started-with-stm32f10xxx-hardware-development-stmicroelectronics.pdf (https://www.st.com/resource/en/application_note/an2586-getting-started-with-stm32f10xxx-hardware-development-stmicroelectronics.pdf)
Here you will find all the basic information about the peripheral components that are required for the MCU. Personally, in my projects, I connect only the HSE crystal oscillator.
Title: Re: about stm32 hardware design
Post by: ajb on August 15, 2022, 04:52:21 pm
If you use USB, the internal clock doesn't have good enough tolerance for the USB specification, although it might work in practice, but isn't guaranteed.

I don't know about these ST parts in particular, but some MCUs can use the USB SOF to discipline an internal oscillator, to allow USB to work without a more accurate local clock.  But in general, yes, internal RC oscillators are much lower accuracy and stability and might not be good enough for sensitive applications, including UART links, so you'll have to look at the datasheet and do the math.
Title: Re: about stm32 hardware design
Post by: ranganatennakoon on August 15, 2022, 10:40:05 pm
If I don't use the RTC functions then adding the 32KHz oscillator is not essential right?
Title: Re: about stm32 hardware design
Post by: thm_w on August 15, 2022, 10:59:13 pm
If I don't use the RTC functions then adding the 32KHz oscillator is not essential right?

Yes, gamalot answered this above.