2020-09-07 03:42 AM
Hi guys,
I am using an stm32L552ZE with an NX2016SA-24MHZ-EXS00A-CS10820 oscilattor. Everithing runs as expected until i get to HSERDY waiting. I get a timeout at this part. For startup I am not running a cutom code and the HSE on code is:
SET_BIT(RCC->AHB2ENR,RCC_AHB2ENR_GPIOCEN);
SET_BIT(RCC->AHB2ENR,RCC_AHB2ENR_GPIOHEN);
SET_BIT(RCC->CR, RCC_CR_HSEON);
tickstart = GetTick_ms();
while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U)
{
if ((GetTick_ms() - tickstart) > HSE_TIMEOUT_VALUE)
{
/*This is done to turn on a led when i get a timeout*/
SET_BIT(RCC->AHB2ENR,RCC_AHB2ENR_GPIOEEN);
MODIFY_REG(GPIOE->OTYPER, (0x01<<7), 0x00000000);
MODIFY_REG(GPIOE->PUPDR, (GPIO_PUPDR_PUPD0 << (POSITION_VAL((0x01<<7)) * 2U)), ((0x2UL) << (POSITION_VAL((0x01<<7)) * 2U)));
return 1;
}
}
I have even waited 10 seconds and still the HSE dose not start. What am I missing?!
Solved! Go to Solution.
2020-09-09 01:41 AM
Thank you all for your support, after reading the post from TDK I have done a complete hardware verification and I notice that the capacitor I was using were 6.8pF in stead of 6pF. After changing the capacitor everything worked fine.
Thank you again for your answers.
2020-09-07 04:53 AM
Presumably because your clock doesn't oscillate.
For a TCXO type source use BYPASS mode.
Provide a clickable link for clock specifications, easier than trying to Google on a phone.
2020-09-07 08:07 AM
Could also be a hardware layout issue, or the crystal is not compatible for the STM32. I don't think BYPASS mode is correct here.
2020-09-09 01:41 AM
Thank you all for your support, after reading the post from TDK I have done a complete hardware verification and I notice that the capacitor I was using were 6.8pF in stead of 6pF. After changing the capacitor everything worked fine.
Thank you again for your answers.
2020-09-09 03:09 AM
Capacitors typically have a pretty high tolerance value. I'm very surprised 6pF worked while 6.8pF did not. Regardless, glad you got it fixed.