尊敬的TI工程师,你们好,我想设置芯片F5172的外部晶振为系统的默认时钟,我看了芯片手册以及一些参考,配置了芯片,但是还存在问题,请工程师们给我纠正一下,以下是我的代码配置:
void init_clock() {WDTCTL = WDTPW + WDTHOLD;// Stop WDTPJSEL |= BIT4+BIT5;// Port select XT1UCSCTL6 &= ~(XT1OFF);// XT1 OnUCSCTL6 |= XCAP_0;// Internal load capUCSCTL6 |= XT1DRIVE_3;UCSCTL3 = 0;// FLL Reference Clock = XT1// Loop until XT2 & DCO stabilizes - In this case loop until XT1 and DCo settledo{UCSCTL7 &= ~(XT1LFOFFG + XT1HFOFFG + DCOFFG);// Clear XT1,DCO fault flagsSFRIFG1 &= ~OFIFG;// Clear fault flags}while (SFRIFG1&OFIFG);// Test oscillator fault flagUCSCTL6 &= ~(XT1DRIVE_3);// Xtal is now stable, reduce drive strengthUCSCTL4 |= SELA_0;// ACLK = LFTX1 (by default)// UCSCTL4 |=SELA__XT1CLK+SELS__XT1CLK+SELM__XT1CLK;__bis_SR_register(GIE);// Enter LPM3__no_operation(); }
gaoyang9992006:
UCSCTL6 |= XCAP_3; // Internal load cap
是不是因为这个配置的电容不对,没有起振
Jeff Wong1:
回复 gaoyang9992006:
电容改成12pF的情况下,也就是UCSCTL6 |= XCAP_3; 但是依旧不起振