广告

原创 点阵99秒显示proteus程序

2009-5-14 09:36 1652 0 分类: MCU/ 嵌入式

http://space.ednchina.com/Upload/2009/5/14/b173a32b-9120-48cf-9766-e4e752a36002.rar                #include <reg51.h>
unsigned char code tab[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
unsigned char code digittab[13][8]={0xff,0xff,0xc1,0xbe,0xbe,0xc1,0xff,0xff, //0
                                    0xff,0xff,0xff,0xff,0xde,0x80,0xfe,0xff, //1
                                    0xff,0xff,0xd8,0xba,0xba,0xba,0xc6,0xff, //2
                                    0xff,0xff,0xdd,0xb6,0xb6,0xb6,0xc9,0xff, //3
                                    0xff,0xff,0xf3,0xeb,0xdb,0x80,0xfb,0xff, //4
                                    0xff,0xff,0x8d,0xae,0xae,0xae,0xb1,0xff, //5
                                    0xff,0xff,0xc1,0xb6,0xb6,0xb6,0xd9,0xff, //6
                                    0xff,0xff,0xbf,0xbf,0xbf,0xb0,0x8f,0xff, //7
                                    0xff,0xff,0xc9,0xb6,0xb6,0xb6,0xc9,0xff, //8
                                    0xff,0xff,0xcd,0xb6,0xb6,0xb6,0xc1,0xff,
         0xcf,0xb7,0xbb,0xdd,0xbb,0xb7,0xcf,0xff ,
         0xed,0xeb,0xc3,0xb7,0xc3,0xeb,0xed,0xff,
                                    0xff,0xff,0xc7,0xbb,0xbb,0xbb,0xc7,0xff  //9
                                    };


unsigned int timecount;
unsigned char cnta;
unsigned char sec;


void main(void)
{
  TMOD="0x02";
  TH0=0x06;
  TL0=0x06;
  TR0=1;
  ET0=1;
  EA="1";
  while(1)
    {;
    }
}


void t0(void) interrupt 1 using 0
{
  P2=tab[cnta];
  P1=digittab[sec/10][cnta];
  P3=tab[cnta];
  P0=digittab[sec%10][cnta];
  cnta++;
  if(cnta==8)
    {
      cnta="0";
    }
  timecount++;
  if(timecount==4000)
    {
      timecount="0";
      sec++;
      if(sec==100)
        {
          sec="0";
         
        }
    }
}

广告

文章评论 0条评论)

登录后参与讨论
相关推荐阅读
aas7502987 2012-04-07 11:48
51/STC最小系统板资料(更新中)
图片欣赏    淘宝网址:http://item.taobao.com/auction/item_detail.htm?item_num_id=9073446988  二   程...
aas7502987 2011-10-13 22:59
YL-3 资料
YL-3数码管模块资料:YL-3 串行数码管资料.zip...
aas7502987 2011-09-24 09:10
USB转TTL小板驱动
xp系统驱动:XP系统支持STC下载的PL-2303HX新版驱动.rar WIN7系统驱动:WIN7系统支持STC下载的PL2303HX驱动.rar...
aas7502987 2011-05-24 22:48
STM32F103RBT6最小系统原理图 PCB
STM32F103RBT6最小系统板原理图 PCB 附件:做好的成品板:淘宝链接网址:http://item.taobao.com/item.htm?id=8864376956...
aas7502987 2011-05-08 12:53
YL-16 STM32F103最小系统板资料(更新中)
二 数据手册:  USB协议中文版:attachment download  中文数据手册:attachment downloadSTM32选型手册:attachment downloadSTM32勘...
aas7502987 2011-03-20 13:27
DS18B20温度测量模块
DS18B20 数码管温度显示程序:...
我要评论
0
0
广告
关闭 热点推荐上一条 /2 下一条