5151单片机仿真300实例。带有c语言代码和proteus仿真。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26447 2009-08-12 13:19 code14
文件 72 2009-08-12 13:19 code14.lnp
文件 13956 2009-08-12 13:19 code14.M51
文件 1421 2009-08-12 13:19 code14.Opt
文件 213 2009-08-12 13:19 code14.plg
文件 2270 2009-08-12 10:06 code14.Uv2
....... 1420 2009-08-12 10:06 code14_Opt.Bak
....... 0 2009-08-12 08:46 code14_Uv2.Bak
文件 2439 2009-08-12 10:03 codeLCD_12864.c
文件 1270 2009-08-12 09:50 codeLCD_12864.h
文件 5661 2009-08-12 13:18 codeLCD_12864.LST
文件 16051 2009-08-12 13:18 codeLCD_12864.OBJ
文件 1166 2009-08-12 10:05 codemain.c
文件 3616 2009-08-12 13:19 codemain.LST
文件 11836 2009-08-12 13:19 codemain.OBJ
文件 6376 2005-03-23 06:22 codeSTARTUP.A51
文件 14049 2009-08-12 13:18 codeSTARTUP.LST
文件 749 2009-08-12 13:18 codeSTARTUP.OBJ
目录 0 2009-08-12 13:19 code
----------- --------- ---------- ----- ----
109012 19
#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar Count;
sbit Dot = P0^7;
uchar code DSY_CODE[]=
{
0x3f0x060x5b0x4f0x660x6d0x7d0x070x7f0x6f
};
uchar Digits_of_6DSY[]={000000};
void DelayMS(uint x)
{
uchar i;
while(--x)
{
for(i=0;i<120;i++);
}
}
void main()
{
uchar ij;
P0 = 0x00;
P3 = 0xff;
Count =0;
TMOD = 0x01;
TH0 = (65535-50000)/256;
TL0 = (65535-50000)%256;
IE = 0x82;
TR0 = 1;
while(1)
{
j = 0x7f;
for(i=5;i!=-1;i--)
{
j=_crol_(j1);
P3 = j;
P0 = DSY_CODE[Digits_of_6DSY[i]];
if(i==1) P0 |= 0x80;
DelayMS(2);
}
}
}
void Time0() interrupt 1
{
uchar i;
TH0 = (65535-50000)/256;
TL0 = (65535-50000)%256;
if(++Count !=2) return;
Count = 0;
Digits_of_6DSY[0]++;
for(i=0;i<=5;i++)
{
if(Digits_of_6DSY[i] == 10)
{
Digits_of_6DSY[i] = 0;
if(i != 5) Digits_of_6DSY[i+1]++;
}
else break;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26447 2009-08-12 13:19 code14
文件 72 2009-08-12 13:19 code14.lnp
文件 13956 2009-08-12 13:19 code14.M51
文件 1421 2009-08-12 13:19 code14.Opt
文件 213 2009-08-12 13:19 code14.plg
文件 2270 2009-08-12 10:06 code14.Uv2
....... 1420 2009-08-12 10:06 code14_Opt.Bak
....... 0 2009-08-12 08:46 code14_Uv2.Bak
文件 2439 2009-08-12 10:03 codeLCD_12864.c
文件 1270 2009-08-12 09:50 codeLCD_12864.h
文件 5661 2009-08-12 13:18 codeLCD_12864.LST
文件 16051 2009-08-12 13:18 codeLCD_12864.OBJ
文件 1166 2009-08-12 10:05 codemain.c
文件 3616 2009-08-12 13:19 codemain.LST
文件 11836 2009-08-12 13:19 codemain.OBJ
文件 6376 2005-03-23 06:22 codeSTARTUP.A51
文件 14049 2009-08-12 13:18 codeSTARTUP.LST
文件 749 2009-08-12 13:18 codeSTARTUP.OBJ
目录 0 2009-08-12 13:19 code
----------- --------- ---------- ----- ----
109012 19
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)