Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 22733

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

$
0
0

Part Number:MSP430G2553

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:

voidconfig_CLK_8MHZ(void) // run clock at 8 MHz

{

    DCOCTL = 0;

    BCSCTL1 = 7;

    BCSCTL1 = CALBC1_8MHZ;

    DCOCTL = CALDCO_8MHZ;

    MHz = 8;

}

 

voidconfig_CLK_1MHZ(void) // run clock at 1 MHz

{

    DCOCTL = 0;

    BCSCTL1 = 13;

    BCSCTL1 = CALBC1_1MHZ;

    DCOCTL = CALDCO_1MHZ;

    MHz = 1;

}


Viewing all articles
Browse latest Browse all 22733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>