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.

[参考译文] 编译器/MSP430G2553:将DCO时钟设置为8MHZ和1MHz

Guru**** 2530720 points
Other Parts Discussed in Thread: MSP430G2553

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/579154/compiler-msp430g2553-setting-dco-clock-to-8mhz-and-1mhz

部件号:MSP430G2553
主题中讨论的其他部件: MSP430WARE

工具/软件:TI C/C++编译器

我们需要将DCO时钟速度设置在1MHz和8MHz之间,具体取决于我们的电源电压。 不过,我不能肯定我们是按适当的次序来订定登记册。  有人能确认我们的做法是正确的吗?或者指出我们在哪些方面出现了问题?

我们的程序如下:

void CONFIG_CLK_8MHZ (void)//以8 MHz运行时钟

    DCOCTL = 0;

    BCSCTL1 = 7;

    BCSCTL1 = CALC1_8MHZ;

    DCOCTL = CALDCO_8MHZ;

    兆赫=8;

}

void CONFIG_CLK_1MHz (void)//以1 MHz运行时钟

    DCOCTL = 0;

    BCSCTL1 = 13;

    BCSCTL1 = CALC1_1MHz;

    DCOCTL = CALDCO_1MHz;

    MHz = 1;

}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好,Dean,

    有关如何将MSP430G2553设置为校准的DCO值的代码示例,请参阅MSP430Ware中的以下代码示例。
    TI资源管理器(CCS或云)-> MSP430Ware ->器件-> MSP430G2xx ->代码示例-> MSP430G2x53 -> msp430g2xxS 3_DCO_flashcal.c.

    根据您编写的代码,在放入校准常数之前,无需写入BCSCL1。