2025-11-26 12:22 PM
I have fitted an 8MHz crystal with 8.2pF capacitors to the NUCLEO-L433RC-P development board, but it is not working.
The software goes to an error handler when configuring the clocks, becuase of a time out iduring the function HAL_RCC_OscConfig (wait till HSE is ready)...
/* Set the new HSE configuration ---------------------------------------*/
__HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState);
/* Check the HSE State */
if(RCC_OscInitStruct->HSEState != RCC_HSE_OFF)
{
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till HSE is ready */
while(READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U)
{
if((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}
}
The part numbers for the crystal and capacitors are below...
Crystal: CG04874-8M
https://www.ndk.com/en/products/upload/lineup/pdf/NDKX03-00009_en.pdf
Capacitors: KGM05ACG1H8R2CH
https://datasheets.kyocera-avx.com/C0GNP0-KGM.pdf
The clock configuration is below...
The board modifications are below:
- fitted X2
- fitted C47 and C48
- connected solder bridges SB67 and SB69
- disconnected solder bridges SB68 and SB70
PS. This relates to my other post about I2S master clock speed...
Solved! Go to Solution.
2025-11-27 8:15 AM
Thanks, I set MSI to 8MHz and was able to achieve 12.571Mhz for the I2S clock (just as I was trying to do with the 8MHz external crystal!)....
2025-11-27 8:23 AM
What Andrew said, and I wonder why you mount 8 MHz in the first place when you know you need 12.288 MHz (I guess for 48k audio) ?
The PLL doesn't have the fraction stuff which I know from the H7s, so 8 MHz doesn't really help.
And for everything that doesn't like clock jitter, like audio and CAN, do not use HSI anyway.
Don't know the MSI mentioned by @gbm .
2025-11-27 9:34 AM - edited 2025-11-27 9:37 AM
Good point I should be trying to fit a 12.888mhz crystal for 48khz audio.
but my system clock is currently running at 80mhz (now using MSI)
If I fit a 12.888MHz crystal then what would the system clock run at ?
2025-11-27 10:13 AM
@freeflyer wrote:Good point I should be trying to fit a 12.888mhz crystal for 48khz audio.
I was suggesting an external oscillator rather than a crystal.
@freeflyer wrote:If I fit a 12.888MHz crystal then what would the system clock run at ?
That will depend on what you do with the PLL and the various dividers ...
2025-11-28 3:31 AM
12.288 MHz
Attention to detail is very important for electronics development!
;)
Check all other peripherals and interfaces if they need a specific clock which might not work with 12.288 MHz *x/y.
For PLL checking CubeMx is really great.