Problem with using external crystal oscillator
Hi Everyone,
We are using the following code to generate clock pulse for STM32F722 from an external 12MHz crystal. However, whatever we do it sounds the STM32F722 gets its clock pulse from an internal 16 MHz oscillator. The reason for using an external 12MHz crystal is because we want to increase the clock pulse frequency up to 120 MHz or higher. I need to mention that there is no hardware problem with the board that we are using. So any help or recommendation for solving this problem will be highly appreciated, thanks.
Here is the code that we are using for generating clock pulse from an external 12MHz crystal:
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 6;
RCC_OscInitStruct.PLL.PLLN = 140;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
RCC_OscInitStruct.PLL.PLLQ = 3;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}