打印

PIC叫板msp430超低功耗

[复制链接]
楼主: machunshui
手机看帖
扫描二维码
随时随地手机跟帖
101

呵呵

盲人摸象?

使用特权

评论回复
102
vividsoft| | 2010-10-23 22:28 | 只看该作者
MSP430牵涉到RAM存储器的操作都是3或者4个指令周期,好像还有5指令周期的.指令效率很低
machunshui 发表于 2009-7-1 12:52


不要单单看一条指令执行的周期数。
就算MSP430的一条双操作数指令,比如:MOV EDE,&TONI,最多需要6个时钟。但是相对于PIC,其每个指令周期含4个时钟,也就是1.5X而已。

但是要知道msp430的这条指令很做多少事情吗?相对于PIC需要几条指令才能完成同样的工作呢?

使用特权

评论回复
103
vividsoft| | 2010-10-23 22:32 | 只看该作者
咱们来看看MSP430 Microcontroller Basics一书Page 154所描述的:

5.6.3 Is the MSP430 a RISC—and Should It Be?
TI describes the MSP430 as having a RISC 16-bit CPU although it is sometimes more
cautious and merely calls it RISC-like. A discussion of the classification alone would be
sterile but it is interesting to see what features of a RISC were adopted by the designers of
the MSP430, which they rejected, and why. Furber [36] has a fascinating and accessible
discussion of RISC and CISC processors focused on the ARM family, which is usually
considered to be one of the first RISC processors although it does not fit the usual
definition fully. Four main features characterize a RISC:
Small set of general-purpose instructions: In contrast to the large number of
instructions with different formats in a CISC (over 250 in the Freescale HCS08, for
instance).
Large bank of general-purpose registers: Used for both data and addresses, in
contrast to the small number of specialized registers in a CISC (the HCS08 has a single
accumulator for data and a separate index register for addresses).
Load–store architecture: In which instructions that process data use only the registers
in the CPU and cannot operate on memory directly; separate instructions load data from
memory into the CPU and store the result back into memory.
Single-cycle execution: Unlike the variable number of cycles required by a CISC.
The MSP430 displays the first two features but not the last two, and it is worth considering
why these were rejected. The basic reason is that small microcontrollers spend much of
their time performing simple operations on registers in the main address space. These
often reconfigure a peripheral. For example, suppose that we wish to stop Timer_A, which
requires bits MC0 and MC1 of TACTL to be cleared. It can be done in a single instruction
in the MSP430:
bic.w #MC0|MC1 ,& TACTL ; stop timer [3 words , 5 cycles]
This requires three words to hold the instruction itself, the immediate data for the source,
and the absolute address for the destination. It takes five cycles to fetch the instruction,
fetch the immediate value, fetch the address of the destination, fetch the original value of
the destination, and write back the modified value of the destination. How would this be
done in a “pure” RISC processor? Here is a possibility, making minimal changes from the
MSP430:
load.w #TACTL ,R4 ; load address of TACTL [2w, 2c]
load.w @R4 ,R5 ; load value of TACTL [1w, 2c]
load.w #MC0|MC1 ,R6 ; load immediate operand [2w, 2c]
bic.w R6 ,R5 ; perform operation [1w, 1c]
store.w R5 ,@R4 ; store result for TACTL [1w, 2c]
I assume that all addresses must reside within the CPU, so that load.w &TACTL,R5
is not permitted; instead we must first store the address as an immediate value into a
register and use indirect addressing. As usual the number of cycles is set by the access to
memory. The bad news is that this requires five instructions, seven words, and nine cycles,
roughly twice the storage and time of the MSP430. This shows immediately why RISC
processors have a reputation for poor code density. The RISC also is slower unless the
processor is simple enough that the speed of the clock could be raised, but in practice this
is probably limited by the speed of the memory rather than the CPU. It may be possible to
embed a byte of immediate data in the instruction, which would assist operations on
peripheral registers with byte access.
Another benefit of the MSP430’s single instruction is that it cannot be broken by an
interrupt—instructions are always completed before an interrupt is taken. The jargon is
that it is atomic. In contrast, an interrupt could occur between the five instructions of the
RISC processor. The programmer may need to guard against potential side effects; see the
section “Issues Associated with Interrupts” on page 196.
Of course it is easy to find examples where the RISC performs better. The inner loop in
MyStrCpy could be rewritten like this:
CopyLoop:
load.b @R14+,R15 ; [1 word , 2 cycles]
store.b R15 ,@R12+ ; [1 word , 2 cycles]
jnz CopyLoop ; [1 word , 2 cycles]
This requires only half the storage and cycles of the version in Listing 5.1. The main saving
comes from autoincrement addressing in the store operation, which is not permitted for a
destination in the MSP430. It is likely that a RISC would offer further addressing modes,
such as predecrement to complement postincrement, and that these could be used with a
base address to provide further indexed modes. Small microcontrollers usually spend more
time writing to peripheral registers than copying or manipulating blocks of data, so the first
example is more relevant. Therefore the designers of the MSP430 chose not to adopt a
strict load–store architecture but to allow operations on main memory instead.

使用特权

评论回复
104
vividsoft| | 2010-10-23 22:36 | 只看该作者
lyjian要讨论MIPS请你另开一个帖子,我天天奉陪.讨论一下你口口声声说得PIC和51谁快.别耽误这个帖子的主题
machunshui 发表于 2009-7-1 14:22


请不要激动,如果用PIC16C5x, mid-range,以及PIC18和8051比的话,那么就执行效率而言pic18才能和传统12T 8051相比,16C5X mid-range是完全无法比的。

但是pic有其优势:1是可靠性非常高 2是指令结构简单,其内部设计简单。

使用特权

评论回复
105
vividsoft| | 2010-10-23 22:38 | 只看该作者
MSP430在电表快要出局了,气表下滑比较厉害,基本守住了水表、热表,但据说水表的局面也是岌岌可危。电表、气表被NEC、FSL、MCHP、NXP、AT、MSP430、RENESAS瓜分的非常严重,包括现在一些国产的IC也抢了不少分额,MS ...
yewuyi 发表于 2009-7-1 17:07


您不觉的您的描述有语病吗?

使用特权

评论回复
106
machunshui|  楼主 | 2010-10-23 23:15 | 只看该作者
不要单单看一条指令执行的周期数。
就算MSP430的一条双操作数指令,比如:MOV EDE,&TONI,最多需要6个时钟。但是相对于PIC,其每个指令周期含4个时钟,也就是1.5X而已。

但是要知道msp430的这条指令很做多少事情 ...
vividsoft 发表于 2010-10-23 22:28


比的不是时钟数目,而是指令数目。
对PIC16而言如果其芯片新能是8MIPS,
实际上效率基本就接近于8MIPS。
因为PIC16是每条指令周期数目大部分都是相同的4 时钟周期。


MSP430 的8MIPS,
远远不是8MIPS,
因为其指令周期长短不一,只要不是寄存器到寄存器操作,
都是多周期指令。

好比MSP430F149速度标称8MIPS,
时间恐怕连5MIPS都够呛。
(msp430是按照寄存器到寄存器操作来标称)。

PIC16F19XX系列的速度标称8MIPS,(PIC16F19XX系列时钟32M)
基本就接近于8MIPS速度。
PIC的MIPS是按照 时钟周期/4来标称的。


在讨论性能能的时候,已经把PIC按照 时钟周期/4 计算过了,

所以不要老是拿时钟周期/4说事。

使用特权

评论回复
107
machunshui|  楼主 | 2010-10-23 23:16 | 只看该作者
要是都比16位的MCU性能,

MSP430和PIC24相比,
差距更大了。

没法比。

使用特权

评论回复
108
machunshui|  楼主 | 2010-10-23 23:18 | 只看该作者
实际上MSP430性能比TI宣传的大打折扣,
因为时间程序必然牵涉到大量的RAM和寄存器之间的输入输出,
只要这些,
MSP的指令周期都没法看

使用特权

评论回复
109
machunshui|  楼主 | 2010-10-23 23:31 | 只看该作者
本帖最后由 machunshui 于 2010-10-23 23:32 编辑

file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/moz-screenshot.png

说明啥???
PIC24F 性能 16MIPS,即时钟速度32M,
那么其FIR滤波相当于32M时钟的MSP430.

PIC24H 性能 30MIPS,即时钟速度60M,
那么其FIR滤波相当于60M时钟的MSP430.

MSP目前性能最大只有多少?
好像不超过25M的速度吧???

使用特权

评论回复
110
machunshui|  楼主 | 2010-10-23 23:34 | 只看该作者
本帖最后由 machunshui 于 2010-10-23 23:37 编辑

这是第三方数据,不存在选择性失明。

以上还是纯数学算(MSP430 可以发挥多寄存器的优点),
要是实际程序(实际程序就不行了,牵涉到大量RAM和寄存器之间的操作),
MSP430更惨。

如今PIC24F,低功耗赶上来了,
够TI头疼的!


可惜国内,PIC24F不好买.

使用特权

评论回复
111
sptek| | 2010-10-23 23:43 | 只看该作者
唉,都是这些美国鬼子的一点伎俩而已,随便一个外围的电容和电阻的就可以把整机功耗升上去。MCU的那几个uA有个屁的用。真正整机功率要做到几百uA的系统也没有几个。都是游戏的工具而已。

使用特权

评论回复
112
machunshui|  楼主 | 2010-10-23 23:50 | 只看该作者
MSP430还有一个特点就是,其能够正常工作频率随着电源电压下降,
锐减!
PIC这点就比MSP430好很多。

这点对于低功耗影响很大。

好比它标称16MIPS速度,
电压稍微降一点其工作频率下降很多,

那么,工作窗口周期就要加长,功耗就加大很多,
(工作时候的功耗占低功耗产品的大头)

使用特权

评论回复
113
sptek| | 2010-10-23 23:53 | 只看该作者
真正做过低功耗产品的,就不会拿哪个MCU功耗低,哪个性能指标高,那基本上都是扯淡的。也没有哪个公司的产品性能就能达到datasheet的那么好。包括TI,用过的应该也知道哪些产品了。低功耗考虑的东西多了去了。环境温度,工作环境。最有权威的就是自己亲手验证才能保证真正上的低功耗。

使用特权

评论回复
114
machunshui|  楼主 | 2010-10-23 23:53 | 只看该作者
本帖最后由 machunshui 于 2010-10-24 00:03 编辑

MICROCHIP驳斥TI SLAY015白皮书.pdf (2.28 MB)

Microchip 驳TI白皮SLAY015全文.pdf

16.25 KB

使用特权

评论回复
115
dl_shuang| | 2010-10-24 00:09 | 只看该作者
MSP430有一个优点,内部定时器工作在32.768KHz时功耗仍很低。
这个好多单片机做不到。
尤其在那些需要单片机频繁启动的系统里。

使用特权

评论回复
116
dl_shuang| | 2010-10-24 00:13 | 只看该作者
唉,都是这些美国鬼子的一点伎俩而已,随便一个外围的电容和电阻的就可以把整机功耗升上去。MCU的那几个uA有个屁的用。真正整机功率要做到几百uA的系统也没有几个。都是游戏的工具而已。 ...
sptek 发表于 2010-10-23 23:43

当你设计电池供电的仪表,而且还需要工作5年以上的时候,你就知道MCU功耗的重要了。

使用特权

评论回复
117
sptek| | 2010-10-24 00:15 | 只看该作者
以前做过一个最低耗要求100uA的的产品。最终不是使用低功耗的MCU解决问题,而是程序技巧,工作方式方面处理来解决。

使用特权

评论回复
118
sptek| | 2010-10-24 00:16 | 只看该作者
传说中的低功耗MCU什么的,基本上解决不了很多实际的产品问题。

使用特权

评论回复
119
McuPlayer| | 2010-10-24 00:20 | 只看该作者
这么久的讨论帖了,很难得啊
现在CM0的势头也很猛,不过真的低功耗的CM0还得继续等待

使用特权

评论回复
120
sptek| | 2010-10-24 00:24 | 只看该作者
当你设计电池供电的仪表,而且还需要工作5年以上的时候,你就知道MCU功耗的重要了。
dl_shuang 发表于 2010-10-24 00:13

并不是说MCU功耗不重要,只是说MCU的功耗是次要的。要从各个因素来解决问题。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则