LED顯示電腦電子鐘
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;本文引用地址:http://www.ex-cimer.com/article/166492.htm
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);
評論