2023-08-27 04:20 PM
ok so when i debug and step through my code the hse ready bit in the rcc-cr register sets to one but when i run it it hangs at my while loop waiting for it to set why does this happen
Solved! Go to Solution.
2023-08-28 12:36 PM - edited 2023-08-28 12:52 PM
so i put a bigger decoupling cap on the vdd vss for the mcu and it works now and i noticed that you have to clear bit 18 before setting bit 16 in the RCC->CR
2023-08-27 04:28 PM
Should set HSEBYP before or at the same time as HSEON.
HSERDY will remain clear until HSE is active. So perhaps you don't have a clock source coming in. What is your hardware? Verify clock with an oscilloscope.
Also note you can't disable HSI while it's being used as a clock source.
2023-08-27 04:38 PM
ii just have a 20mhz crystal hooked up to pin 1 and pin 8 can i measure a crystal with occiliscope or logic analizer
2023-08-28 12:36 PM - edited 2023-08-28 12:52 PM
so i put a bigger decoupling cap on the vdd vss for the mcu and it works now and i noticed that you have to clear bit 18 before setting bit 16 in the RCC->CR