请问MSP-EXP430FR5739这块板子焊接外部时钟晶振就这样就行了么?(图片在最下面)
但板子还是一直置XT1 fault flag,还需要焊接外部电容电阻么?在哪焊接,测试程序如下:
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT // setup XT1 PJSEL0 |= BIT4 + BIT5; CSCTL0_H = 0xA5;
CSCTL1 |= DCOFSEL0 + DCOFSEL1; // Set max. DCO setting
CSCTL2 = SELA_0 + SELS_3 + SELM_3; // set ACLK = XT1; MCLK = DCO
CSCTL3 = DIVA_0 + DIVS_1 + DIVM_1; // set all dividers CSCTL4 |= XT1DRIVE_0; CSCTL4 &= ~XT1OFF;
P1DIR |= BIT0;
P1OUT |= BIT0;
do
{
CSCTL5 &= ~XT1OFFG;
P1OUT = 0x01; // Clear XT1 fault flag
SFRIFG1 &= ~OFIFG; }while (SFRIFG1&OFIFG); // Test oscillator fault flag
TA0CTL = TASSEL_1 + MC_2 + TACLR + TAIE; // ACLK, contmode, clear TAR
// enable interrupt
__bis_SR_register(LPM3_bits + GIE); // Enter LPM3, enable interrupts
__no_operation(); // For debugger
}
// Timer0_A3 Interrupt Vector (TAIV) handler
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=TIMER0_A1_VECTOR
__interrupt void TIMER0_A1_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER0_A1_VECTOR))) TIMER0_A1_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch(__even_in_range(TA0IV,14))
{
case 0: break; // No interrupt
case 2: break; // CCR1 not used
case 4: break; // CCR2 not used
case 6: break; // reserved
case 8: break; // reserved
case 10: break; // reserved
case 12: break; // reserved
case 14: P1OUT ^= 0x01; // overflow
break;
default: break; }
}
灰小子:
不用焊接外部电容的。msp430内部带了多个可供选择的负载电容,可以根据需要选择使用。
Susan Yang:
另外关于晶振的问题,TI有一份相关文档您可以参考一下,希望对您有所帮助!
www.ti.com.cn/…/zhca445b.pdf