选择不了外部时钟
请先检查硬件,比如外部时钟是否起振
程序请参考:
unsigned char i = 0;
/*--------------------------------------------------
- Change on-chip oscillator clock to Main clock -
---------------------------------------------------*/
prc0 = 1; /* Protect off */
cm13 = 1; /* Xin Xout */
cm15 = 1; /* XIN-XOUT drive capacity select bit : HIGH */
cm05 = 0; /* Xin on */
cm16 = 0; /* Main clock = No division mode */
cm17 = 0;
cm06 = 0; /* CM16 and CM17 enable */
while (i <= 100) /* This setting is an example of waiting time for the */
i++; /* oscillation stabilization. Please evaluate the time */
/* for oscillation stabilization by a user. */
ocd2 = 0; /* Main clock change */
prc0 = 0; /* Protect on */
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |