[MSP430]入门之一 整体认识

这是由TI公司推出的一款比较单片机, 相对stm32来说简单些, 因为它是16位的,  所以我们在学习中可能也会像51一样,  直接操纵寄存器.

TI设计这款单片机的初衷是, 让它用于低功耗的嵌入式设备中.

Reduced instruction set computing, or RISC (pronounced 'risk'), is aCPU design strategy based on the insight that a simplified instruction set (as opposed to a complex set) provides higher performance when combined with amicroprocessor architecture capable of executing those instructions using fewermicroprocessor cycles per instruction


以上是MSP430使用的精简混合指令集  wiki解释, 也是为了降低功率

MSP430也使用了集成模拟外设, 能够降低功耗,提高启动速度




单片机的自动运行与时钟系统分不开,始终系统通常需要满足4个条件:

1.高频率            用于快速响应

2.低频性           用于降低电流消耗

3. 稳定的频率  满足定时需求 如 RTC real-time clock

4.多时钟源      允许单片机在不同的频率下工作,可以同时使用外部晶振和内部振荡器,例如 DCO

MSP430内部有3个时钟, 用于应对不同系统最小化能量消耗

MCLK 主时钟

SMCLK副时钟

ACLK辅助时钟

The MSP430 features 3 clocks which can run at maximum of 16MHz depending upon the conditions. The reason we have three clocks instead of just one or even two is to compromise between systems that need speed and the ability to minimize power consumption, which is what the msp430 was designed for.  These three clocks are:-

  • MCLK:  This stands for Master Clock, and is the one that drives the processor most of the time.  
  •               由DCO产生 ,也可由外部振荡器产生, 启动需要6us, 一般用于CPU 和高速外设
  • SMCLK: The Sub-Main Clock is a secondary clock which is used by other peripherals particularly the internal peripherals.
  •              外设选择时钟源的时候使用
  • ACLK: The Auxiliary Clock is usually timed outside the MSP430 and is typically used for peripherals.
  •              一般用于低俗外设,可以设置

开始一个工程的开头必然是配置时钟了

DCO是digital controled Oscillator,  数字晶振,  它没有外部竞争准确,  但是控制的范围已经很广了, 一定够用.

DCO可以控制时钟,  它由两个寄存器操作


Apart from a versatile clock system, we have 4 different sources to control these three clocks.  We will have a look at them at the correct time, however for now one of is theDCO. It’s the digitally controlled oscillator which might not be as accurate or stable while compared to external crystals, but still is quite good and can operate over a wide range of frequencies.

Lets’ move onto the DCO.  The advantage with the DCO is that it requires no external parts and can be fully controlled by the software.  There are only two registers should be configured to change yourDCO frequency and that areDCOCTL and BCSCTL1.

这两句话用寄存器把DCO设置为1MHZ;

basic clock select controller

BCSCTL1=CALBC1—1MHZ; 
DCOCTL=CALDCO—1MHZ;
设置MCLK

BCSCTL2 |= SELM——1+DIVM_3;



  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值