AnsweredAssumed Answered

Clock Switching Problem

Question asked by Mohammed Galal on Mar 13, 2018
Latest reply on Mar 14, 2018 by Szymon Panecki

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 switching

CLK_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 ??

Outcomes