2019-04-08 01:27 PM
Hello All
I am using Nucleo F446re. I am trying to switch my system clock from the default 16-MHz HSI to the external 8-MHz HSE (which is already supplied as MCO by a crystal to Pin 5 of the MCU, as the schematic shows). To that end, is there anything involved other than setting HSEBYP and HSEON bits in the RCC_CR? While these have not worked alone, I have also tried to turn HSI off by clearing HSION bit before or after the aforementioned bit settings, but with no success; the system does not allow HSI to be turned off.
I have checked with a scope and seen that a robust 8-MHz pulse is indeed present at the corresponding OSC_IN GPIO pin. So a lack of pulse is not the cause.
Thank you for any insights.
Amir
2019-04-08 02:03 PM
Besides setting HSEBYP and HSEON, you also want to switch the source of system clock. So, if you sourced the system clock from HSI, switch in RCC_CFGR.SW to HSE and wait until done. If PLL is involved, you need to switch the source of that, in RCC_PLLCFGR.PLLSRC, before you even switch PLL on.
JW
2019-04-08 03:42 PM
Thank you, Jan. I proceeded as advised and succeeded.
One other, related, question: Do one have to be careful playing with clocks and their prescaler values? Can the device be damaged by exceeding the limits?
CubeMX would hint when maximum ratings were to be exceeded, but I am not using CubeMX anymore. Rather, I am doing register-level programming.
Amir
2019-04-08 04:28 PM
>>Can the device be damaged by exceeding the limits?
No, It just stops functioning as you miss delivery deadlines on critical signal paths.
2019-04-08 05:27 PM
Thanks.