This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/MSP430G2553: Setting DCO clock to 8MHZ and 1MHz

Part Number: MSP430G2553
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;

}

  • Hello Dean,

    For a code example of how to set the MSP430G2553 to the calibrated DCO values, please see the following code example located within MSP430Ware.
    TI Resource Explorer (CCS or Cloud) -> MSP430Ware -> Devices -> MSP430G2xx -> Code Examples -> MSP430G2x53 -> msp430g2xx3_dco_flashcal.c

    From the code you have written, you do not need to write to BCSCTL1 before you place in the calibration constant.

**Attention** This is a public forum