cancel
Showing results for 
Search instead for 
Did you mean: 

Clock configuration using different oscillators

pedro1
Associate II

I am trying to adapt some code generated in Cube-MX for use on the STM32F4RG used in two very similar projects. The code was written for a drone flight control board and the oscillator used https://www.digikey.com.au/product-detail/en/murata-electronics-north-america/CSTCE8M00G55-R0/490-1195-1-ND/584632 has both an OSC IN and OSC OUT connected to PH0 and PH1 respectively. The project that I am adapting the code for uses an SMD type that only uses OSC IN connected to the aforementioned chip https://www.digikey.com.au/product-detail/en/abracon-llc/ASA-8.000MHZ-L-T/535-11721-1-ND/2809916

My question is how do I set up the chip in Cube_MX to use the SMD OSC that only has one pin. Cube_MX doesn't seem to allow me to just use OSC IN on PH0 and I cannot work out why. I compiled the code just leaving PH1 as OSC OUT because someone said that is was just there to quote "The osc out is a signal to excite the crystal if it is there. If it is not there, no problem" I am having trouble getting the compiled code to do what it should be doing and am not convinced that the OSC is set up correctly in Cube even though it compiled OK and was able to be flashed to the project. Any thoughts or ideas appreciated please.

2 REPLIES 2
turboscrew
Senior III

What's STM32F4RG? Usually in the STM32s have by-pass bit that is meant for that.

Instead of HSE_ON use HSE_BYPASS.

Sorry I forgot a couple of numerics there didn't I :grinning_face: STM32F405RG https://www.digikey.com.au/product-detail/en/stmicroelectronics/STM32F405RGT6TR/497-17432-1-ND/8024114

I will give HSE_BYPASS a try. Thanks a lot