Other Parts Discussed in Thread: MSP430FR2355, LP-MSPM0G3507
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