2014-04-03 04:17 AM
Dear friends,
How can I use external oscillator with STM32F030R8? I try it with Discovery Kit but it can not work properly? Do we need something with software side? When we do it with STM32F100R series, it is easy but we can not solve for this one? with my best regards. OZTURK, Metin. #stm322014-04-03 04:31 AM
Does the board have an external 8 MHz crystal? Or is it connected by solder-bridges to the 8 MHz output of the F103 providing the ST-LINK function? Are those bridges made? Refer to manual and schematic.
If you use the 8 MHz output, the HSE should be enabled with BYPASS mode.2014-04-03 04:37 AM
How can I use external oscillator with STM32F030R8?
I try it with Discovery Kit but it can not work properly?
Consult the schematics of your discovery board. I have a F051 and a F072 discovery board, both are clocked from the integrated STLink, but with a reserved space for a quartz. You will need to remove a soldering bridge if populating a quartz - as said, consult the schematics and the discovery user manual. To find a suitable oscillator, check the requirements in your MCU's datasheet. I am no hardware developer, so I won't comment on that.
2014-04-04 12:10 AM
Dear friends,
Thank you very much for your helps. I did something according to user manuel. I use 16MHz external. But it works 8MHz. Do we have to do something in software side? Or when we use our own boards, what kind of configurations do we have to do? ''Oscillator onboard
. From X2 crystal (not provided). For typical frequencies and its
capacitors and resistors, please refer to the STM32F030R8T6 datasheet.
Configuration needed:
– SB16, SB17, SB18 OPEN
– R22, R23, C13, C14 soldered
''2014-04-04 01:03 AM
Could it be that the 8 MHz clock output from the STLink is overdriving your quartz ?
Have you checked this :– SB16, SB17,
SB18 OPEN
2014-04-08 02:12 AM
2014-04-08 06:56 AM
You should look to the standard library rather than the Discovery one, you'd need to adjust the PLLMUL value to account for the faster oscillator, and the HSE_VALUE define (stm32f0xx_conf.h? or project wide)
STM32F0xx_StdPeriph_Lib_V1.3.1\Projects\STM32F0xx_StdPeriph_Examples\ADC\ADC_AnalogWatchdog\system_stm32f0xx.c SetSysClock() RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6); // 8 MHz * 6 = 48 MHz changes too RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL3); // 16 MHz * 3 = 48 MHz2014-04-09 07:13 AM
Thank you very much for your helps.
We solved the problem by changing something in system_stm32f00xx.c But I think it was a difficult loop to select external oscillator. :)/* Select HSE as system clock source */
RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW)); RCC->CFGR |= (uint32_t)RCC_CFGR_SW_HSE; /* Wait till HSE is used as system clock source */ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x04) { }// PLL configuration = HSE * 6 = 48 MHz */
/* RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL)); RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL2); // Enable PLL RCC->CR |= RCC_CR_PLLON;// Wait till PLL is ready
while((RCC->CR & RCC_CR_PLLRDY) == 0) { }// Select PLL as system clock source
RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW)); RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;// Wait till PLL is used as system clock source
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)RCC_CFGR_SWS_PLL) { }*/ On the other hand, we need your helps about TIM 17 PWMOut issue. We can not produce TIM17 N channel out. with my best wishes. Öztürk, Metin.