Dear *,
we have connected 24MHz oscillator on XIN pin of MSP430FR2353.
i'm unable to set the MCLK to 24MHz, i'm observing pin P2.6 as MCLK out and i'm getting 1MHz ( probably the fall-back mode)
Am i doing something wrong at CS initialization ?
code
#include <msp430.h> #include <driverlib.h> void init_CS(); /** * main.c */ int main(void) { volatile uint32_t i; // Stop watchdog timer WDT_A_hold(WDT_A_BASE); // Disable the GPIO power-on default high-impedance mode // to activate previously configured port settings PMM_unlockLPM5(); // Initialize external XT1CLK = 24MHz init_CS(); // Output MCLK on P2.6 P2DIR |= BIT6; // Configure P2.6 as output direction pin P2SEL0 |= BIT6; // Select P2.6 as MCLK out P2SEL1 &= ~(BIT6); // Select P2.6 as MCLK out // Set P6.1 to output direction GPIO_setAsOutputPin( GPIO_PORT_P6, GPIO_PIN1 ); while(1) { // Toggle P6.1 output GPIO_toggleOutputOnPin( GPIO_PORT_P6, GPIO_PIN1 ); // Delay for(i=10000; i>0; i--); } } void init_CS() { //CSCTL4 // set XT1CLK source for ACLK, MCLK, SMCLK CSCTL4 = SELMS__XT1CLK | SELA__XT1CLK; //CSCTL5 // SMCLK ON | SMCLK DIV = 1 | MCLK DIV = 1 CSCTL5 = SMCLKOFF_0 | DIVS_0 | DIVM_0; //CSCTL6 // EN XT1 fault | ACLK = MCLK/768 | HDS | HF mode | XT1 EXT | 24MHz CSCTL6 = XT1FAULTOFF_0 | DIVA_8 | XT1DRIVE_3 | XTS_1 | XT1BYPASS_1 | XT1HFFREQ_3; //CSCTL7 // Clear XT1 fault flag CSCTL7 &= ~(XT1OFFG); }
Best Regards,
David.