Mon May 26 12:59:07 2008: MSP430.DLL version 1.15
Mon May 26 12:59:07 2008: Device : MSP430F44x
Mon May 26 12:59:10 2008: Loaded module
Mon May 26 12:59:10 2008: Target reset
Mon May 26 12:59:10 2008: Driver does not support code coverage.
Mon May 26 12:59:10 2008: Error: Operation error.
Mon May 26 12:59:10 2008: Couldn't go to 'main'.
请大家帮帮忙?
/*************************LED 显示程序******************************************/
/* 此程序是针对于msp447学习班编写,对led显示进行测试, 程序中有一个测试测试led数码管*/
/* 是否正常的test()函数。本程序根据电路板上led的设置,可显示6位数字和小数点,显示范围*/
/*推荐为0.0 ~ 999999,大于此范围的数字自动截取右边高6位,当显示的数字大于6位时,高6位*/
/*显示,低位去掉 */
/************************结束**************************************************/
//MSP-Test44x Demo lcd ,led dishplay the timer
//
// MSP430F449
// -----------------
// /|\| XIN|-
// | | | 74HC373(1)&(2)
// --|RST XOUT|- -------------
// | | | |
// | P3.1|------>|D0 |
// | . | . | |
// | P3.7|------>|D7 |
// | P4.0|------>| |
// | P4.1|------>| |
// | |
//
// Zhang Chong
// Lierda, Inc
// MAY 2004
// Built with IAR Embedded Workbench Version: 1.26B
//****************************************************************************
#include "msp430x44x.h"
#define LED1 0x3E;
#define LED2 0x3D;
#define LED3 0x3B;
#define LED4 0x37;
#define LED5 0x2F;
#define LED6 0x1F;
int Digit[10]={0XD7,0X14,0XCD,0X5D,0X1E,0X5B,0XBB,0X15,0XDF,0X5F};
void Delay(int m)
{
while(m-->0);
}
void Display(int pos,int x,int point)
{
int BitSel;
int temp;
switch (pos)
{
case 1:
BitSel = LED1;
break;
case 2:
BitSel = LED2;
break;
case 3:
BitSel = LED3;
break;
case 4:
BitSel = LED4;
break;
case 5:
BitSel = LED5;
break;
case 6:
BitSel = LED6;
break;
default:
break;
}
P3DIR = 0XFF;
if(point)
P3OUT = Digit[x]+ 0x20; //display point
else
P3OUT = Digit[x];
temp = P3OUT;
P3OUT = 0X00;
P4OUT = 0X02; //DATA CHOOSE BIT SET;
P4OUT = 0X00; //DATA CHOOSE BIT RESET,CLOSE;
P3OUT = temp;
P4OUT = 0X02;
P4OUT = 0X00;
P3OUT = BitSel;
P4OUT = 0x01;
P4OUT = 0X00;
Delay(500);
}
void Send_Data(float Data)
{
unsigned long xx;
int temp;
int i = 6;
if(Data<1.0)
{
xx = Data * 100000;
while(xx !=0)
{
temp = xx % 10;
if(temp != 0)
{
Display(i,temp,0);
i--;
}
xx = xx / 10;
}
Display(i,0,1);
i = 6;
}
else if(Data<10.0)
{
xx = Data * 100000;
while(xx !=0)
{
temp = xx % 10;
if(temp != 0)
{
if(xx<10 && i<6)
Display(i,temp,1);
else
Display(i,temp,0);
i--;
}
xx = xx / 10;
}
i = 6;
}
else if(Data<100.0)
{
{
xx = Data * 10000;
while(xx !=0)
{
temp = xx % 10;
if(temp != 0)
{
if(xx> 9 && xx<100 && i<6)
Display(i,temp,1);
else
Display(i,temp,0);
i--;
}
xx = xx / 10;
}
i = 6;
}
}
else if(Data<1000.0)
{
{
xx = Data * 1000;
while(xx !=0)
{
temp = xx % 10;
if(temp != 0)
{
if(xx>99 && xx<1000 && i<6)
Display(i,temp,1);
else
Display(i,temp,0);
i--;
}
xx = xx / 10;
}
i = 6;
}
}
else if(Data<10000.0)
{
{
xx = Data * 100;
while(xx !=0)
{
temp = xx % 10;
if(temp != 0)
{
if(xx>999 && xx<10000 && i<6)
Display(i,temp,1);
else
Display(i,temp,0);
i--;
}
xx = xx / 10;
}
i = 6;
}
}
else if(Data<100000.0)
{
{
xx = Data * 10;
while(xx !=0)
{
temp = xx % 10;
if(temp != 0)
{
if(xx>9999 && xx<100000 && i<6)
Display(i,temp,1);
else
Display(i,temp,0);
i--;
}
xx = xx / 10;
}
i = 6;
}
}
else if(Data<1000000.0)
{
{
xx = Data;
while(xx !=0)
{
temp = xx % 10;
if(temp != 0)
{
Display(i,temp,0);
i--;
}
xx = xx / 10;
}
i = 6;
}
}
}
//***************test of segment of led ***********//
/*void test(void)
{
int i;
int temp;
P3OUT = 0x01;
for(i=0;i<8;i++)
{
temp = P3OUT;
P4OUT = 0X02;
P4OUT = 0X00;
P3OUT = 0X3e;
P4OUT = 0X01;
P4OUT = 0X00;
Delay(20000);
P3OUT = 0x00;
P4OUT = 0X02;
P4OUT = 0X00;
P3OUT = 0X3e;
P4OUT = 0X01;
P4OUT = 0X00;
Delay(20000);
P3OUT = temp;
P3OUT = P3OUT << 1;
}
}
*/
void main(void)
{
while(1)
{
WDTCTL = WDTHOLD+WDTPW;
P4DIR = 0X03;
P3DIR = 0XFF;
P3OUT = 0X00; //clear all the leds display
P4OUT = 0X02; //data select choose
P4OUT = 0X00;
Send_Data(1118.88888);
}
}
我现在解决了,从IAR主页上下载了最新软件安装上以后就没问题了,不过是4K代码限制的。让我贴代码却不会回答,真是没话说,谢谢hzuser