2025-06-18 3:08 PM
Hi.
I was searching for a crystal that meets the requiremets for the HSE of the MCU I´m using (STM32L4P5RGT6) at the beginning I tried to make the corresponding calcuations by myself but after researching I noticed that for some calculation I needed make physical measurements of the crystal (I dont even have the crystal as well as the oscilloscope) because of that I tried to have some guidance on evalutation boards that implemented the same line of the MCU I was trying to use on its evaluation board, but I found that many of the evaluation board use LSE using 32.768kHz crystals, so in that point I ask my self "What external clock source do I need in first place?"
I`m going to implement the above MCU with basic componentes that ones to can start the MCU as well as some DCMI interface ans some serial interfaces as well (I2C, SPI), analog peripherals and USB.
I´m beginner in the MCU design so, what external clock source do I need?
Thanks for your help.
2025-06-19 2:08 AM
Hi @Aldo_Flores_Aguayo ,
The HSE clock is typically used for the main system clock and peripherals requiring high-speed operation, while the LSE one is used for driving the Real-Time Clock (RTC) or maintaining low-power operation.
Based on what you introduced as application, LSE will not fit your requirement.
The application note AN2867 can provide valuable insights into selecting the suitable crystal as well as designing the oscillator circuit.
To understand more about the STM32 clock system, I invite you to refer to the following knowledge articles:
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-06-19 3:06 PM
Thanks for your time @Amel NASRI It was really helpful information now I have more clear understanding of clock tree, I´ll tell you a bit about whats going with my design:
Don´t know if is really hard to find the appropiate crystal for my HSE socillator for my MCU, but I tryed looking for evaluation boards that use the same MCU line as mine (STM32L4P5RGT6) but at this moment I cant find some evaluation board that implement a crystal on the HSE for reference design, they only use LSE oscillator, for another side: something importat to say is that I don´t have an oscillocope to measure my crystal current I mean I don´t even have the crystal because I could find which fist my need becase of the previous reasons commented before all this because some calculations to dertermine If I need a Rext need this data (to find drive level of my oscillator)
So do you have any suggestion on how to have an idea on what crystal would fit my needs without the need of physical measurements, or I can just take another MCU line that has HSE (og¡f course in the same frequency range as the MCU line I´m using) and look for some crystal that already use on its designs ??
Thank you for any help!
2025-06-19 5:53 PM
What is your requirement for system clock accuracy?
For the L4 (and others) the internal MSI accuracy can be improved by autocorrecting with an LSE. And you get an accurate RTC function. That's probably why some ST boards have only an LSE. Read the MCU datasheet for details.
2025-06-20 12:48 PM
Hi @Hal3
As I comment before I´m beginner in this about oscillator design, and the only constrain I had was to use a crystal between the frequency range my MCU accepts and use the HSE maybe because I read It is more accurate, but now I´m asking me how to define the requierements for the type of clock to use I mean what should I take in account to decide if use HSI, HSE, MSI, LSI etc, hope you can tell me where to watch to to define what clock is better to use on my MCU.
Thank you.
2025-06-21 10:56 AM
"use the HSE maybe because I read It is more accurate"
That's a good goal, but I am suggesting you evaluate whether or not using the MSI autocorrected by an LSE meets your accuracy requirements. The data sheet states 0.25% accuracy, adequate for USB and U(S)ART to PC Terminal COMM. You will have to determine if that accuracy is adequate for your timers, ADC, audio, etc. frequency dependent applications.
The MCU starts up on the MSI, and can be set to a wide range of frequencies, making it easy to obtain whatever SYSCLOCK and peripheral clock frequencies you need. You can use an ST board LSE design and have an accurate RTC for determining date and time.
2025-06-23 2:39 AM
Hi @Aldo_Flores_Aguayo ,
In AN2867, we provide the requirements for resonator selection:
And we suggest an example in UM2179, while we don't provide it by default in the board NUCLEO-L4P5ZG:
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-06-24 1:07 PM
Hi. @Amel NASRI Thanks for the recommendation, you refered to this crystal right? (attached image below)
One question here is that I can select another crystal with the same characteristics, i.e. same load capacitance, shunt capacitance, ESR and use it instead the model (NX3225GD-8.000M-EXS00A-CG04874[N/A]) proposed in the document you mention?
Another maybe basic question but what does men the curve line in each line (OSC-IN and OCS-OUT) respectively?
Thanks for your time.
2025-06-24 1:12 PM
Hi @Hal3 thanks for reply.
Yes that just what I wanted to know, I mean where to look and what type of info do I need regarding to the applications let´s say ADC, audio etc, in my case I2C communications and the use of DMCI?
Of coursce once I know the accuracy of my different clock sources inside the MCU?
Thanks again.
2025-06-24 7:01 PM
"in my case I2C communications"
I2C (and SPI) connected devices typically work well over a wide range of communication clock frequencies, so MCU clock accuracy is typically of no concern for these devices.