Other Parts Discussed in Thread: MSP430WARE
Tool/software: TI C/C++ Compiler
We need to set the DCO clock speed back and forth between 1MHz and 8MHz, depending our supply voltage. I am not certain that we are setting the registers in the proper order, though. Can anyone confirm that we are doing this correctly -- or point out where we have things out of order?
Our routines are as follows:
void config_CLK_8MHZ(void) // run clock at 8 MHz
{
DCOCTL = 0;
BCSCTL1 = 7;
BCSCTL1 = CALBC1_8MHZ;
DCOCTL = CALDCO_8MHZ;
MHz = 8;
}
void config_CLK_1MHZ(void) // run clock at 1 MHz
{
DCOCTL = 0;
BCSCTL1 = 13;
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
MHz = 1;
}