单片机C语言keil编译出现错误,寄存器容量不足,怎么改正,急!!!!
#include"reg52.h"//电机IO#defineGPIO_MOTORP1//sbitF1=P1^0;//sbitF2=P1^1;//sbitF3=P1^2;/...
#include "reg52.h" //电机IO
#define GPIO_MOTOR P1
//sbit F1 = P1^0;
//sbit F2 = P1^1;
//sbit F3 = P1^2;
//sbit F4 = P1^3;
//按键IO
sbit K1=P3^0;
sbit K2=P3^1;
sbit K3=P3^2;
sbit K4=P3^3;
unsigned char code FFW[8]={0xf1,0xf3,0xf2,0xf6,0xf4,0xfc,0xf8,0xf9}; //反转顺序
unsigned char code FFZ[8]={0xf9,0xf8,0xfc,0xf4,0xf6,0xf2,0xf3,0xf1}; //正转顺序
unsigned char Direction,Speed;
void Delay(unsigned int t);
void Motor();
void main(void)
{
unsigned char i;
Speed=30;
while(1)
{
if(K1==0) //检测按键K1是否按下
{ Delay(1); //消除抖动
if(K1==0)
{
Direction=1;
}
while((i<200)&&(K1==0)) //检测按键是否松开
{
Delay(1);
i++;
}
i=0;
}
if(K2==0) //检测按键K1是否按下
{
Delay(1); //消除抖动
if(K2==0)
{
Direction=2;
}
while((i<200)&&(K2==0)) //检测按键是否松开
{
Delay(1);
i++;
}
i=0;
}
if(K3==0) //检测按键K1是否按下
{
Delay(1); //消除抖动
if(K3==0)
{
Speed=13;
}
while((i<200)&&(K3==0)) //检测按键是否松开
{
Delay(1);
i++;
}
i=0;
}
if(K4==0) //检测按键K1是否按下
{
Delay(1); //消除抖动
if(K4==0)
{
Speed=40;
}
while((i<200)&&(K4==0)) //检测按键是否松开
{
Delay(1);
i++;
} i=0;
} Motor();
}
}
void Motor()
{
unsigned char i;
for(i=0;i<8;i++)
{
if(Direction==1)
GPIO_MOTOR = FFW[i]&0x1f; //取数据
if(Direction==2)
GPIO_MOTOR = FFZ[i]&0x1f;
Delay(Speed); //调节转速
}
}
void Delay(unsigned int t)
{
unsigned int k;
while(t--)
{
for(k=0; k<80; k++)
{ }
}
}
完了之后显示错误:
Build target 'Target 1'
assembling Main.asm...
A51 MACRO ASSEMBLER V8.00 - SN: K1U9C-3F31ZR
COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2005
"f:\Keil\C51\BIN\A51.EXE" "Main.asm" SET (SMALL) DEBUG EP
A51 FATAL ERROR -
ERROR: LIMIT EXCEEDED: SYMBOL-TABLE SPACE EXHAUSTED
A51 TERMINATED.
Target not created
我的keil安装时有序列号,应该不是未破解的原因。 展开
#define GPIO_MOTOR P1
//sbit F1 = P1^0;
//sbit F2 = P1^1;
//sbit F3 = P1^2;
//sbit F4 = P1^3;
//按键IO
sbit K1=P3^0;
sbit K2=P3^1;
sbit K3=P3^2;
sbit K4=P3^3;
unsigned char code FFW[8]={0xf1,0xf3,0xf2,0xf6,0xf4,0xfc,0xf8,0xf9}; //反转顺序
unsigned char code FFZ[8]={0xf9,0xf8,0xfc,0xf4,0xf6,0xf2,0xf3,0xf1}; //正转顺序
unsigned char Direction,Speed;
void Delay(unsigned int t);
void Motor();
void main(void)
{
unsigned char i;
Speed=30;
while(1)
{
if(K1==0) //检测按键K1是否按下
{ Delay(1); //消除抖动
if(K1==0)
{
Direction=1;
}
while((i<200)&&(K1==0)) //检测按键是否松开
{
Delay(1);
i++;
}
i=0;
}
if(K2==0) //检测按键K1是否按下
{
Delay(1); //消除抖动
if(K2==0)
{
Direction=2;
}
while((i<200)&&(K2==0)) //检测按键是否松开
{
Delay(1);
i++;
}
i=0;
}
if(K3==0) //检测按键K1是否按下
{
Delay(1); //消除抖动
if(K3==0)
{
Speed=13;
}
while((i<200)&&(K3==0)) //检测按键是否松开
{
Delay(1);
i++;
}
i=0;
}
if(K4==0) //检测按键K1是否按下
{
Delay(1); //消除抖动
if(K4==0)
{
Speed=40;
}
while((i<200)&&(K4==0)) //检测按键是否松开
{
Delay(1);
i++;
} i=0;
} Motor();
}
}
void Motor()
{
unsigned char i;
for(i=0;i<8;i++)
{
if(Direction==1)
GPIO_MOTOR = FFW[i]&0x1f; //取数据
if(Direction==2)
GPIO_MOTOR = FFZ[i]&0x1f;
Delay(Speed); //调节转速
}
}
void Delay(unsigned int t)
{
unsigned int k;
while(t--)
{
for(k=0; k<80; k++)
{ }
}
}
完了之后显示错误:
Build target 'Target 1'
assembling Main.asm...
A51 MACRO ASSEMBLER V8.00 - SN: K1U9C-3F31ZR
COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2005
"f:\Keil\C51\BIN\A51.EXE" "Main.asm" SET (SMALL) DEBUG EP
A51 FATAL ERROR -
ERROR: LIMIT EXCEEDED: SYMBOL-TABLE SPACE EXHAUSTED
A51 TERMINATED.
Target not created
我的keil安装时有序列号,应该不是未破解的原因。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询