Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 22238

MSP430FR2155: Using External 5MHz Oscillator On XT1

$
0
0
Part Number: MSP430FR2155

Tool/software:

My Current Code to test setting up the oscillator is as follows:

int main(void) {
    WDT_A_hold(WDT_A_BASE);
//Configure MCLOCK OUtput Pin
    GPIO_setAsPeripheralModuleFunctionOutputPin(
                        GPIO_PORT_P3,
                        GPIO_PIN0,
                        GPIO_PRIMARY_MODULE_FUNCTION
                        );
//Configure XIN and XOUT pins
    GPIO_setAsPeripheralModuleFunctionInputPin(
               GPIO_PORT_P2,
               GPIO_PIN7,
               GPIO_SECONDARY_MODULE_FUNCTION
           );
//Turn on bypass mode
    CS_bypassXT1();
//source MCLOCK from XT1
    CS_initClockSignal(CS_MCLK,CS_XT1CLK_SELECT,CS_CLOCK_DIVIDER_1);
//Clear flags after starting oscillator
    CS_clearAllOscFlagsWithTimeout(1000);
    while(1){

    }
}

When run this code gets stuck trying to call CS_bypassXT1(). It gets stuck on the following while statement in cs.c:

while (HWREG8(CS_BASE + OFS_CSCTL7) & (XT1OFFG)) {
    //Clear OSC fault flags
    HWREG8(CS_BASE + OFS_CSCTL7) &= ~(XT1OFFG);

    // Clear the global fault flag. In case the XT1 caused the global fault
    // flag to get set this will clear the global error condition. If any
    // error condition persists, global flag will get again.
    HWREG8(SFR_BASE + OFS_SFRIFG1) &= ~OFIFG;
}

Any help would be appreciated


Viewing all articles
Browse latest Browse all 22238

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>