Tool/software: Code Composer Studio
Good afternoon.
Running an EVM. I have a small block of code to set up ACLK to 32kHz LFXT and use the DCO with FLL at 16MHz for SMCLK, MCLK. If I run code with the debugger I get 16MHz clock just fine. If I remove all the jumpers other than Ground that connect the EZ-FET to the Target and plug a power supply into 3.3V (verified) my code doesn't seem to work the same. Meaning...I have an LED to turn on after the clock has been set up. With debugger LED turns on, without debugger and using the power supply LED does not turn on HOWEVER the clock appears to be running at 16MHz. My question is can someone please verify for me that my clock setup seems to be correct? I specifically do NOT want to do the TRIM piece that is talked about in the user guide. Would just like to set the DCO and an FLL and run close to the 16MHz. Also any ideas as to why the LED doesn't want to come on when no debugger yet clock runs.
FRCTL0 = FRCTLPW | NWAITS_2; do { CSCTL7 &= ~(XT1OFFG | DCOFFG); // Clear XT1 and DCO fault flag SFRIFG1 &= ~OFIFG; } while (SFRIFG1 & OFIFG); // Test oscillator fault flag __bis_SR_register(SCG0); // disable FLL CSCTL3 |= SELREF__XT1CLK; // Set XT1 as FLL reference source CSCTL0 = 0x155; CSCTL1 = DCORSEL_5;// DCOFTRIM=5, DCO Range = 16MHz CSCTL2 = FLLD_0 + 487; // DCOCLKDIV = 16MHz CSCTL6 = 0x0030; __delay_cycles(3); __bic_SR_register(SCG0); // enable FLL // Software_Trim(); while(CSCTL7 & (FLLUNLOCK0 | FLLUNLOCK1)); CSCTL4 = SELMS__DCOCLKDIV | SELA__XT1CLK; // set XT1 (~32768Hz) as ACLK source, ACLK = 32768Hz
Thanks
Steve