【正文】
。 k1=k11。 DO WHILE K1=0FFH。 K1=7。 END。 END。 end。 IF SK=0 THEN DO。CALL TIME(100)。 /*SET KEY PROCESS*/ TIME1=30。 IF SK=0 THEN DO。 tem=tem+1。 tem=dec(tem)。 DO CASE K1。 DO WHILE tem=7。/*week*/ tem=0。 END。 DO WHILE tem=60H。/*scond*/ tem=0。 END。 DO WHILE tem=60H。/*minute*/ tem=0。 END。 DO WHILE tem=24H。/*hour*/ tem=0。 END。 DO WHILE tem=32H。/*date*/ tem=1。 END。 DO WHILE tem=13H。/*month*/ tem=1。 END。 DO while tem=100h。 /* YEAR */ tem=00。 END。 DO WHILE TEM=21H。 tem=19H。 END。 END。 A(K1)=tem。 if k1=7 then a(8)=tem。 END。 END。 END。 END。end key。main$program:mk=1。sk=1。temp1=0。num=0。p32=1。if sk=0 then call beginset。clk=0。da=0。ale=1。loop: do while mk=1 。 if a(0)6 then a(0)=0。 mand=0bfh。 call rbyt8。 call display。 do while mk=0。 call key。 call wbyt1(8eh,0)。 mand=0beh。 call wbyt8。 call wbyt1(0C0H,A(8))。 call wbyt1(8eh,80h)。 end。 end。goto loop。end start。例3:saved from url=(0044)~jlsplhd/ 一個(gè)6位LED、4個(gè)按鍵的顯示板 按鍵和顯示是單片機(jī)系統(tǒng)的基本輸入輸出部件,下面介紹一個(gè)由74LS164驅(qū)動(dòng)的6位數(shù)碼管和4個(gè)按鍵組成的通用儀表面板。 原理圖如下圖所示: 其線路板圖如下圖所示: 注:此板中多了三個(gè)LED發(fā)光管,這三個(gè)發(fā)光管是分別接在IC4,IC5,IC6 的13腳(Q7,數(shù)據(jù) 串出腳)上的。