小弟用keil c写了一个51控制的8*8滚屏显示,编译通过了,但仿真没通过帮忙找下错啊,大侠们

#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
void delay (uchar t )
{
uchar x,y;
for(x=t;x>0;x--)
{
for(y=110;y>0;y--)
{
}
}
}
void init_to()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
}
uchar time,timeout;
void exeter0()
interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
time++;
if (time==20)
{
time=0;
timeout++;
}
if (timeout==8)
{
timeout=0;
}
}

uchar code led640_0[]={0x01,0x02,0x4,0x08,0x10,0x20,0x40,0x80};
uchar code led640_1[]={0xff,0xef,0xd7,0xbb,0x7d,0x6d,0x93,0xff};
display_led64(uchar h,uchar l)
{
P2=h;
P3=l;
delay(5);
P2=0x00;
P3=0xff;
delay(1);
}
uchar k,temp;
void main ()
{
init_to();
while(1)
{
void init_to();
while(timeout==0)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}
while(timeout==1)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}
while(timeout==2)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}

while(timeout==3)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}
while(timeout==4)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}
while(timeout==5)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}
while(timeout==6)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}
while(timeout==7)
{
for(k=0;k<8;k++)
{
temp=led640_1[k];
temp=_crol_(temp,timeout);
}
display_led64(led640_0[k],temp);
}
}
}
你看我的左循环,和定时器对吗

第1个回答  2012-05-08
把单片机的外围电源晶振电路画出来试试看追问

没用,要不你给我写个历程,我看一下,多谢了,还会加分的