Part Number: MSP430FR5964
Other Parts Discussed in Thread: MSP430FR2155
Tool/software:
HI,
I am bringing up a MSP430FR5964IPNR on our development PCB. We are using the HFXT2 with an external 3.3V clock oscillator at 10MHz. (Note we have recently done this successfully with similar part MSP430FR2155). The 10MHz square wave from the oscillator looks good going into HFXIN pin 74 on the device. The device does not clear the alarm flag HFXTOFFG and switch to the HFXT2 input. We have routed MCLK out on pin 68 and see that it is not the same frequency or in sync with HFXIN. I assume it is running off the DCO as the HFXTOFFG can't be cleared. I've gone through the registers settings and believe they are set correctly. Copy of code snippet below:
Thanks in Advance,
Adam
// *******************************************************************************************************
// Must write to Clock Source Key before any other registers can be written
CSCTL0 = CSKEY;
// MCLK = HF EXT, SMCLK = HF EXT, ACLK = VLO INT
CSCTL2 = SELM__HFXTCLK | SELS__HFXTCLK | SELA__VLOCLK;
// MCLK, SMCLK, ACLK all divide by 1
CSCTL3 = DIVM__1 | DIVS__1 | DIVA__1;
// Turn off LFEXT, HFFREQ = 8-16MHz (running at 10MHz), Bypass 3.3V Clock Osc used.
CSCTL4 = LFXTOFF_1 | HFFREQ_2 | HFXTBYPASS;
// ************************************************************************
// Clock Testing Pins
// ************************************************************************
// Send MCLK out pin 68 for diagnostics
P5DIR |= BIT7;
P5SEL0 |= BIT7;
P5SEL1 |= BIT7;
// Wait "some time" for XT2 to become clock source
static volatile uint16_t _xt1FailCnt = 0;
do
{
_xt1FailCnt++;
// Clear HFXT
CSCTL5 &= ~(HFXTOFFG);
SFRIFG1 &= ~OFIFG;
// Test XT2 fault flag and loop iterations
} while ((CSCTL5 & HFXTOFFG) && (_xt1FailCnt < 1000));//((SFRIFG1 & OFIFG) && (_xt1FailCnt < 1000));
_xt1FailCnt = _xt1FailCnt;