使用的是STM8207,晶振用24M
初始化:
CLK_ECKR |=0X1; //开启外部时钟
while(!(CLK_ECKR&0X2)); //等待外部时钟rdy
CLK_CKDIVR &= 0XF8; //CPU无分频
CLK_SWR = 0XB4; //选择外部时钟
while(!(CLK_SWCR&0X8)); //这里要等
CLK_SWCR |=0X2; //使能外部时钟
CLK_HSICmd(DISABLE);
在线运行时提示错误:Thu Oct 10 16:51:58 2013: Failed to read memory at 0x3D: SWIM error [30004]: Comm timeout
|