2011-07-25 08:35 AM
I need to config my stm8s105k6 to work with oscillator of 16Mhz
my code : CLK_ClockSwitchCmd ( ENABLE ); CLK->SWR = 0xB4; CLK->SWR = 0xB4; while ( !(CLK->CMSR == 0xB4 ) ); I get stuck behind the while loop Am I missing something ? #hse-config2011-07-25 11:22 PM
you're missing at the beginning:
/* Enables Clock switch */
CLK->SWCR |= CLK_SWCR_SWEN;
or better use:
CLK_ClockSwitchConfig(CLK_SWITCHMODE_AUTO, CLK_SOURCE_HSE, DISABLE, DISABLE);
brazov