Question
Clock Switching Problem
Posted on March 13, 2018 at 19:14
Hi all,
I'm using STM8l052R8 MCU.
I'm trying to switch the clock from HSI to LSI but I can't.
this is my code:
{
CLK_DeInit(); //deinitiate clock
CLK_SYSCLKSourceSwitchCmd(ENABLE); //enable switchingCLK_LSICmd(ENABLE); //enable LSI oscillator
CLK->SWR = 0x02; // choose LSI as a clock source
}
the debugger doesn't work correctly. I'm using ST-Link Debugger.
Is this code Is correct or How to confirm that I switched to LSI correctly ??