5550|1

6366

帖子

4914

TA的资源

版主

楼主
 

MSP430G2 DCO 频率设置 [复制链接]

MSP430G2 DCO Frequencies

MSP430 LaunchPad (MSP-EXP430G2) is compatible with many of the TI‘s Value Line series of microcontrollers. For these MCUs, both the Master clock (MCLK) and the sub-main clock (SMCLK) can be driven directly by the internal DCO, without having to use an external crystal. This is very useful in situations where timing requirement is not so strict. In this blog posting, I will show you all the discrete frequencies that can be generated by only using the DCO. The charts included below will come in handy when you are designing your MSP430G2 based circuits.

The DCO frequency in MSP430G2 device is controlled by the DCOCTL register and the RSEL bits in the BCSCTL1 register. We can achieve 128 discrete frequency settings using only the 3 DCO bits in DCOCTL and the 4 RSEL bits in BCSCTL1. By mixing two adjacent DCO frequencies using the frequency modulation bits (MOD) in DCOCTL, 32 additional equivalent frequency intervals can be achieved between the two frequencies. In the examples here, we will only concentrate on generating all the DCO frequencies without using the modulation bits.

The initDCO function below sets the DCO frequency according to the DCO bits and RSEL bits (I used TI’s Code Composer Studio, you will likely need to change the code if other IDEs are used). In this function, MCLK is routed from DCOCLK (SELM_0) and 1:1 clock dividers are used.

1
2
3
4
5
6
7
8
9
10
11
/**
 * Initialize DCO according to DCO and RSEL
 * Example: DCO = DCO1 + DCO2 + DCO3
 *      RSEL= RSEL0 + RSEL1 + RSEL2 + RSEL3
 */
void initDCO(int DCO, int RSEL)
{
    DCOCTL = DCO;
    BCSCTL1 = XT2OFF + DIVA_0 + RSEL;
    BCSCTL2 = SELM_0 + DIVM_0 + DIVS_0;
}

The DCO frequencies can be outputted via port 1.4 so they can be measured by a frequency counter or an oscilloscope.

1
2
P1SEL = BIT4;
P1DIR = BIT4;

The following table shows the 128 discrete frequencies generated on a MSP430G2231 MCU (click to enlarge) by the different combinations of the DCO and RSEL bits.

MSP430G2XX DCO Frequencies

MSP430G2XX DCO Frequencies

The above table can also be downloaded here in Excel format: MSP430DCOFrequencies.xls

The chart below shows the 128 frequencies with different DCO and RSEL settings.

MSP430XX DCO Frequencies

MSP430XX DCO Frequencies

For instance, the following code would generate a DCO frequency of roughly 15.8 MHz:

1
initDCO(DCO1 + DCO0, RSEL3);

Please keep in mind that the frequencies in the chart above are likely to vary somewhat among different chips as they are not calibrated. You should only use this chart to derive the approximate DCO frequency. On different chips, these frequencies can vary 5% to 10% with the same DCO and RSEL settings.

最新回复

MARK.  详情 回复 发表于 2012-7-17 10:38
 
点赞 关注

回复
举报

134

帖子

0

TA的资源

一粒金砂(中级)

沙发
 
MARK.
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/9 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表