This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
程序如下:
void setup_FLL(void) {//启动晶振和时钟; WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer UCSCTL6 &= ~(XT1OFF); // XT1 On do { UCSCTL7 &= ~XT1LFOFFG; // Clear XT1 fault flags for (int i = 30000; i; i--); } while (UCSCTL7 & XT1LFOFFG); // Test XT1 fault flag UCSCTL3 = SELREF__XT1CLK; // Set DCO FLL reference UCSCTL4 = SELS__DCOCLKDIV + SELM__DCOCLK + SELA__XT1CLK; __delay_cycles(781250); while (SFRIFG1&OFIFG) // Test oscillator fault flag { // Clear fault flags UCSCTL7 &= ~(XT1LFOFFG + DCOFFG); // Clear XT2,XT1,DCO fault flags SFRIFG1 &= ~OFIFG; // Clear fault flags for (int i = 30000; i; i--); } }
问题描述:程序运行后,会在最后一个while(SFRIFG1&OFIFG)中循环,此时DCOFFG与OFIFG置位,XT1LFOFFG 为0。发现问题后,进入单步调试,发现断点在SFRIFG1 &= ~OFIFG;处正常,但下一步单调时,UCSCTL0值变为0x00f8,即MOD{32},DCO{0}。
我猜测是MOD{32},DCO{0}后,引发DCOFFG,再触发了OFIFG。但想不通为何UCSCTL0值一开始还正常,但后来变为0x00f8?想请教论坛上的高人指点一下,谢谢!
在网上查了一下,发现有篇帖子也提到将AUXVCC3接上VCC就解决问题了,我试了一下果然可以,但AUXVCC3不是后备电源吗?难道不接这个电源,RTC和XT1的晶振就不工作了?
对呀,user guide里有写阿
If AUXVCC3 is not powered by a dedicated supply, it can either be connected to DVCC externally or powered by enabling the AUXVCC3 charger. If powered by the charger, the recommended capacitor should be connected externally. If AUXVCC3 is not powered or connected to DVSS, the backup subsystem (including, for example, the 32-kHz crystal oscillator) is not functional.
AUXVCC3 要么外接到DVCC,要么配置成charger外接电容。 这个管脚电波动了XT1 就挂了。
手册里我没找到你提的那句话啊。。。我看的是msp430f6733,MSP430x5xx and MSP430x6xx Family User's Guide
不过的确找到了一句:The Backup subsystem operates on a dedicated power supply AUXVCC3. This subsystem includes lowfrequency
oscillator (XT1), Real-Time Clock module, and Backup RAM.
好吧,我承认手册是写了的。不过为什么要把XT1归为Backup subsystem啊。。。我用个外部低频晶振,去看Crystal Oscillator, XT1, Low-Frequency Mode,去看Unified Clock System (UCS),不会去看Backup Subsystem的啊。。。