2015-09-03 12:23 AM
Hello,
We're using an STM32F103RD for one of our product and on which an extrenal crystal (768Khz) is connected on OSC32 In and ON (LSE). My problem is that this crystal only start to oscillate when the scope probe is touching the OSC32IN pin. The crystal is an ABS25-32768-6T, the load capacitor is 6pf (and tried with 2.2pF too) and the ext resistor is 0 ohm. To configure the F1 clock tree, I use the HAL function (version 1.0.1):__PWR_CLK_ENABLE();
__BKP_CLK_ENABLE();
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL3;
HAL_RCC_OscConfig(&RCC_OscInitStruct);
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK|RCC_CLOCKTYPE_PCLK1 /*|RCC_CLOCKTYPE_PCLK2*/;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; // DIV4
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; //DIV2
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1);
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
I never get this kind of problem before !
Anyone have an idea to solve my problem.
Thanks in advance
Olivier
2015-09-03 03:02 AM
Hi ghislain.olivier,
For STM32F103RD it is recommended to mount an additional parallel feedback resistor (from 16 MΩ to 22 MΩ) on board to help the oscillation start-up in all cases (seehttp://www.st.com/web/en/resource/technical/document/errata_sheet/CD00197763.pdf
).For more details on compatible crystals and hardware techniques on PCB, refer to .-Syrine-2015-09-07 12:10 AM
Thanks for your answer.
I tried with an parallel resistor but the crystal doesn't start without the scope probe. But I think the problem is coming from a PCB layout problem. the crystal is a bit far from the stm32 and doesn't have its own ground plane. Olivier