在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 單片機應用實例:LED顯示電腦電子鐘

            單片機應用實例:LED顯示電腦電子鐘

            作者: 時間:2013-02-07 來源:網(wǎng)絡 收藏

              源程序清單如下(無溫度顯示程序):

              start:do;

              $include(reg51.dcl)

              declare (sclk,io,rst) bit at (0b3h) register; /* p33,p34,p35 */

              declare (command,data,n,temp1,num) byte;

              declare a(9) byte;

              declare ab(6) byte;

              declare aco(11) byte constant (0fdh,60h,0dah,0f2h,66h,0b6h,0beh,

              0e0h,0feh,0f6h,00h);

              declare week(11) byte constant (0edh,028h,0dch,7ch,39h,75h,0f5h,

              2ch,0fdh,7dh,00h);

              declare da literally 'p15',clk literally 'p16',ale literally 'p17',

              mk literally 'p11',sk literally 'p12';

              clear:procedure;

              sclk=0;io=0;rst=0;

              end clear;

              send1302:procedure(comm);

              declare (i,comm) byte;

              do i=0 to 7;

              comm=scr(comm,1);

              io=cy;

              call time(1);

              sclk=0;

              call time(1);

              sclk=1;

              end;

              end send1302;

              wbyt1:procedure(com,dat);/*字節(jié)寫過程*/

              declare (com,dat) byte;

              call clear;

              rst=1;

              call send1302(com);

              call send1302(dat);

              call clear;

              end wbyt1;

              wbyt8:procedure;/*時鐘多字節(jié)突發(fā)模式寫過程*/

              declare j byte;

              call clear;

              a(7)=A(6);a(6)=a(0);

              rst=1;

              call send1302(command);

              do j=1 to 8;

              call send1302(a(j));

              end;

              call clear;

              end wbyt8;

              RBYT1:PROCEDURE;

              DECLARE I BYTE;

              CALL CLEAR;

              RST=1;

              call send1302(0c1h);

              IO=1;

              DO I=0 TO 7;

              SCLK=1;

              SCLK=0;

              CY=IO;

              N=SCR(N,1);

              END;

              A(8)=N;

              CALL CLEAR;

              END RBYT1;

              send595:procedure;

              declare k byte;

              do k=0 to 7;

              data=scr(data,1);

              da=cy;

              clk=1;

              clk=0;

              end;

              end send595;

              send595_1:procedure;

              declare k byte;

              do k=0 to 7;

              data=scr(data,1);

              da1=cy;

              clk1=1;

              clk1=0;

              end;

              end send595_1;

              rb1:procedure(abc,j);

              DECLARE (I,j,abc) BYTE;

              CALL CLEAR;

              RST=1;

              call send1302(abc);

              IO=1;

              DO I=0 TO 7;

              SCLK=1;

              SCLK=0;

              CY=IO;

              N=SCR(N,1);

              END;

              ab(j)=N;

              ab(j)=dec(ab(j));

              CALL CLEAR;

              end rb1;

              rbyt6:procedure;

              call rb1(0f1h,0);

              call rb1(0f3h,1);

              call rb1(0f5h,2);

              call rb1(0f7h,3);

              call rb1(0f9h,4);

              call rb1(0fbh,5);

              call rb1(0fdh,6);

              end rbyt6;

              wbyt6:procedure;

              call wbyt1(8eh,0); /* write enable */

              call wbyt1(0f0h,ab(0));

              call wbyt1(0f2h,ab(1));

              call wbyt1(0f4h,ab(2));

              call wbyt1(0f6h,ab(3));

              call wbyt1(0f8h,ab(4));

              call wbyt1(0fah,ab(5));

              call wbyt1(0fch,ab(6));

              call wbyt1(8eh,80h); /* write disable */

              end wbyt6;

              rbyt8:procedure;/*時鐘多字節(jié)突發(fā)模式讀過程*/

              declare (i,j) byte;

              call clear;

              rst=1;

              call send1302(command);

              io=1;

              do j=1 to 8;

              do i=0 to 7;

              sclk=1;

              call time(1);

              sclk=0;

              cy=io;

              n=scr(n,1);

              end;

              a(j)=n;

              end;

              call clear;

              a(0)=a(6);a(6)=A(7);

              a(0)=a(0) and 0fh;

              if a(0)>6 then a(0)=0;

              CALL RBYT1;

              if (a(1)=0 and a(2)=0 and a(3)=0) then

              do;

              do num=0 to 35;

              call time(250);

              end;

              temp1=1;

              end;

              if temp1=1 then

              do;

              temp1=0;

              ab(4)=ab(4)+1;

              if ab(4)>99h then

              do;

              ab(4)=0;

              ab(5)=ab(5)+1;

              if ab(5)>99h then ab(5)=0;

              end;

              call wbyt6;

              end;

              end rbyt8;

              display:procedure; /*jieya,yima,fasong*/

              declare (i,n,m) byte;

              n=a(0) and 0fh; /* send week */

              data=week(n);

              call send595;

              n=a(4); /* send date */

              n=n and 0fh;

              data=aco(n);

              call send595;

              n=a(4);

              n=shr(n,4);

              data=aco(n);

              call send595;

              do i=1 to 3; /* send second,minute,hour */

              n=a(i);

              n=n and 0fh;

              data=aco(n);

              call send595;

              n=a(i);

              n=shr(n,4);

              data=aco(n);

              call send595;

              end;

              do i=5 to 6; /* send month,year */

              n=a(i);

              n=n and 0fh;

              data=aco(n);

              call send595;

              n=a(i);

              n=shr(n,4);

              data=aco(n);

              call send595;

              end;

              n=a(8); /* send 19 or 20 */

              n=n and 0fh;

              data=aco(n);

              call send595;

              n=a(8);

              n=shr(n,4);

              data=aco(n);

              call send595;

              do m=0 to 5;

              n=ab(m);

              n=n and 0fh;

              data=aco(n);

              call send595_1;

              n=ab(m);

              n=shr(n,4);

              data=aco(n);

              call send595_1;

              end;

              ale=0;

              ale=1;

              end display;

              beginset:procedure;

              a(0)=06h;a(1)=58h;a(2)=59h;a(3)=23h;

              a(4)=30h;a(5)=06h;a(6)=97h;a(7)=00;

              a(8)=19h; /* set date/time (1997,7,1,8:00:00,week 3) */

              call wbyt1(8eh,0); /* write enable*/

              call wbyt1(80h,00h);/* start colock */

              call wbyt1(0beh,0abh);/*兩個二極管與8K電阻串聯(lián)充電*/

              command=0beh; /* write colock/date */

              call wbyt8;

              call wbyt1(0c0h,a(8));

              call wbyt1(8eh,80h); /* set write protect bit */

              end beginset;

              key:procedure;

              declare (i,time1,k1,tem) byte;

              call time(100);

              k1=7;time1=30;

              if mk=0 then

              do;

              do while time1>0;

              week: if k1=0 then

              do;

              do i=0 to 5;

              /* call hz(a(0)); */

              end;

              do i=0 to 3;

              /* call hz0; */

              end;

              end;

              tem=a(k1);

              if k1=7 then tem=a(8);

              a(k1)=0aah;

              if k1=7 then a(8)=0aah;

              call display;

              call time(254);

              call time (254);

              a(k1)=tem;

              if k1=7 then a(8)=tem;

              call display;

              call time(254);

              call time(254);

              call time(254);

              time1=time1-1;

              if mk=0 then

              do;call time(100); /*MOD KEY PROCESS*/

              TIME1=30;

              IF MK=0 THEN

              DO;

              k1=k1-1;

            單片機相關(guān)文章:單片機教程


            單片機相關(guān)文章:單片機視頻教程


            單片機相關(guān)文章:單片機工作原理




            關(guān)鍵詞: 單片機 LED顯示 電腦電子鐘

            評論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉