Dear Wizards,
This code is executed during startup (it is called from xdc_runtime_Startup_reset__I )
static void spin_100_uS (void) {
volatile unsigned char count = 79u; /* Empirically determined */
while (--count > 0u)
; /* Busy Wait */
}
extern "C" {
void CSL_Init_Basic_Clock (void)
{
int index;
BCSCTL1 = 0xFDu; /* ACLK <-- LFXT1CLK / 8; XT2 Off; RSELx=13($D) */
BCSCTL2 = 0xC0u; /* MCLK, SMCLK <-- DCOCLK/1 */
BCSCTL3 = 0xF0u; /* External Clock Source */
for (index = 0; index < 3; ++index) { /* Try 3 times */
IFG1 &= ~0x02u; /* Clear Oscillator fault flag */
spin_100_uS(); /* Wait at least 50 uS */
if (0u == (IFG1 & 0x02u)) {
break;
}
}
DCOCTL = 0x80u; /* DCO = 4 */
}
void CSL_Disable_Watchdog (void)
{
WDTCTL = 0x5A00u + WDTHOLD + WDTSSEL;
}
} /* extern "C" */
When the target is running standalone the clocks are correct. When debugging the clock module always has the PowerUp Reset values:
DCOCTL = 0x60
BCSCTL1= 0x87
BCSCTL2= 0x00
BCSCTL3= 0xF0
It feels like I have not setup the debugger properly. Any suggestions?
Target: MSP430F2618
Debugger: MSP-FET430UIF
CCS: 5.2.0.00069
Compiler: 4.1.0
BIOS: 6.33.4.39
RTSC/XDC: 3.23.3.53
Thank you,
Fred