⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 6-2.txt

📁 单片机应用开发实例.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
         low3=0h;
      end;
      if toc(1).mer>estep then toc(1).ave=1;
      if toc(2).mer>estep then toc(2).ave=1;
      if toc(3).mer>estep then toc(3).ave=1;
      if (toc(1).ave+toc(2).ave+toc(3).ave)<1 then tor(i+128).err=55h;
      do ii=1 to 8;
         null=hsi_time;
      end;

end err3;

err4: procedure; 
      do ii=1 to 3;
         portd=80h;
         ;
         portb=0ffh-i; 
         ;
         portc=10h;
         ;
         latter=0h;
         latt=timer1;
         ;
         do while latter <1ff0h;
            ;
            ;
            latter=timer1-latt;
         end;
         ;
         portd=80h;
         ;
         portc=1fh;     
         call time(2800);
         tod(ii).mer=(high4-low4)/500;       
         high4=0h;
         low4=0h;
      end;
      if tod(1).mer>estep then tod(1).ave=1;
      if tod(2).mer>estep then tod(2).ave=1;
      if tod(3).mer>estep then tod(3).ave=1;
      if (tod(1).ave+tod(2).ave+tod(3).ave)<1 then tor(i+192).err=55h;
      do ii=1 to 8;
         null=hsi_time;
      end;

end err4;

fir1: procedure;
      do ii=1 to 3;
         portd=80h;
         ;
         portb=0ffh-i; 
         ;
         portc=10h;
         ;
         latter=0h;
         latt=timer1;
         ;
         do while latter <1ff0h;
            ;
            ;
            latter=timer1-latt;
         end;
         ;
         portd=80h;
         ;
         portc=1fh;     
         call time(2800);
         toa(ii).mer=(high1-low1)/500;
         high1=0h;
         low1=0h;
      end;
      if toa(1).mer>40 then toa(1).ave=1;
      if toa(2).mer>40 then toa(2).ave=1;
      if toa(3).mer>40 then toa(3).ave=1;
      do ii=1 to 8;
         null=hsi_time;
      end;

end fir1;

fir2: procedure; 
      do ii=1 to 3;
         portd=80h;
         ;
         portb=0ffh-i; 
         ;
         portc=10h;
         ;
         latter=0h;
         latt=timer1;
         ;
         do while latter <1ff0h;
            ;
            ;
            latter=timer1-latt;
         end;
         ;
         portd=80h;
         ;
         portc=1fh;     
         call time(2800);
         tob(ii).mer=(high2-low2)/500;
         high2=0h;
         low2=0h;
      end;
      if tob(1).mer>40 then tob(1).ave=1;
      if tob(2).mer>40 then tob(2).ave=1;
      if tob(3).mer>40 then tob(3).ave=1;
      do ii=1 to 8;
         null=hsi_time;
      end;

end fir2;

fir3: procedure; 
      do ii=1 to 3;
         portd=80h;
         ;
         portb=0ffh-i; 
         ;
         portc=10h;
         ;
         latter=0h;
         latt=timer1;
         ;
         do while latter <1ff0h;
            ;
            ;
            latter=timer1-latt;
         end;
         ;
         portd=80h;
         ;
         portc=1fh;     
         call time(2800);
         toc(ii).mer=(high3-low3)/500;
         high3=0h;
         low3=0h;
      end;
      if toc(1).mer>40 then toc(1).ave=1;
      if toc(2).mer>40 then toc(2).ave=1;
      if toc(3).mer>40 then toc(3).ave=1;
      do ii=1 to 8;
         null=hsi_time;
      end;

end fir3;

fir4: procedure; 
      do ii=1 to 3;
         portd=80h;
         ;
         portb=0ffh-i; 
         ;
         portc=10h;
         ;
         latter=0h;
         latt=timer1;
         ;
         do while latter <1ff0h;
            ;
            ;
            latter=timer1-latt;
         end;
         ;
         portd=80h;
         ;
         portc=1fh;     
         call time(2800);
         tod(ii).mer=(high4-low4)/500;
         high4=0h;
         low4=0h;
      end;
      if tod(1).mer>40 then tod(1).ave=1;
      if tod(2).mer>40 then tod(2).ave=1;
      if tod(3).mer>40 then tod(3).ave=1;
      do ii=1 to 8;
         null=hsi_time;
      end;

end fir4;
lamp1:procedure;
      portd=80h;
      ;
      portb=0ffh-i; 
      ;
      portc=9eh;
      ;
      call time(200);
      portd=80h;
      ;
      portc=1fh;     
      call time(2800);
      do ii=1 to 8;
         null=hsi_time;
      end;
end lamp1;

lamp2:procedure;
      portd=80h;
      ;
      portb=0ffh-i; 
      ;
      portc=9dh;
      ;
      call time(200);
      portd=80h;
      ;
      portc=1fh;     
      call time(2800);
      do ii=1 to 8;
         null=hsi_time;
      end;
end lamp2;

lamp3:procedure;
      portd=80h;
      ;
      portb=0ffh-i; 
      ;
      portc=9bh;
      ;
      call time(200);
      portd=80h;
      ;
      portc=1fh;     
      call time(2800);
      do ii=1 to 8;
         null=hsi_time;
      end;
end lamp3;

lamp4:procedure;
      portd=80h;
      ;
      portb=0ffh-i; 
      ;
      portc=97h;
      ;
      call time(200);
      portd=80h;
      ;
      portc=1fh;     
      call time(2800);
      do ii=1 to 8;
         null=hsi_time;
      end;
end lamp4;
firxun: procedure;
       if tor(i).fir=0 then
       do;
          portd=80h;
          ;
          portb=0ffh-i; 
          ;
          portc=1eh;
          ;
          latt=timer1;
          latter=0h;
          ;
          do while latter <1ff0h;
          ;
          ;
          ;
          latter=timer1-latt;
          end;
          ;
          portd=80h;
          ;
          portc=1fh;     
          call time(2800);
          tor(i).mer=(high1-low1)/500;
          high1=0h;
          low1=0h;
       end;
       if tor(i+64).fir=0 then
       do;
          portd=80h;
          ;
          portb=0ffh-i; 
          ;
          portc=1dh;
          ;
          latt=timer1;
          latter=0h;
          ;
          do while latter <1ff0h;
          ;
          ;
          ;
          latter=timer1-latt;
          end;
          ;
          portd=80h;
          ;
          portc=1fh;     
          call time(2800);
          tor(i+64).mer=(high2-low2)/500;
          high2=0h;
          low2=0h;
       end;
       if tor(i+128).fir=0 then
       do;
          portd=80h;
          ;
          portb=0ffh-i; 
          ;
          portc=1bh;
          ;
          latt=timer1;
          latter=0h;
          ;
          do while latter <1ff0h;
          ;
          ;
          ;
          latter=timer1-latt;
          end;
          ;
          portd=80h;
          ;
          portc=1fh;     
          call time(2800);
          tor(i+128).mer=(high3-low3)/500;
          high3=0h;
          low3=0h;
       end;
       if tor(i+192).fir=0 then
       do;
          portd=80h;
          ;
          portb=0ffh-i; 
          ;
          portc=17h;
          ;
          latt=timer1;
          latter=0h;
          ;
          do while latter <1ff0h;
          ;
          ;
          ;
          latter=timer1-latt;
          end;
          ;
          portd=80h;
          ;
          portc=1fh;                                            
          call time(2800);
          tor(i+192).mer=(high4-low4)/500;
          high4=0h;
          low4=0h;
       end;
end firxun;
print:procedure; 
        do j=0 to prnumb
           ;
           pta=test(j);
           ;
           ioport1=0fh;
           ;
           kw=10h;
           ptm=sec-1;
           do while kw>8h;
              ptm=sec-ptm;
              if ptm>5 then goto zz;
              ad_command=8h;
              do iii=1h to 200h;
              ;
              end;
              kw=high(ad_result);
           end;
           ioport1=0h;
        end;
        call time(10000);
zz:     ;
end print;
/*
ad5:procedure; 

end;
adbet:procedure; 

end; */
adlin:procedure; 
           a=0h;     
           b=0h;
           ad_command=0eh;       
           call time(10);
           wsr=0;
           a=low(ad_result);
           b=high(ad_result);
           if b<20h and errzx=0 and fire=0 then 
           do;
              pt8255=pt8255 or 18h;
              ptd=80h;
              ;
              ;
              ptc=pt8255;
              zsd87=zsd87 and 0fdh;
              w79=87h;
              w79d=zsd87;
              zsd89=zsd89 or 80h;
              w79=89h;
              w79d=zsd89;
              do i=0 to 178;
                 test(i)=test5(i);
              end;
              test(161)=year3+30h;
              test(162)=year4+30h;
              test(164)=moun1+30h;
              test(165)=moun2+30h;
              test(167)=day1+30h;
              test(168)=day2+30h;
              test(171)=hour/10+30h;
              test(172)=(hour-hour/10*10)+30h;
              test(174)=min/10+30h;
              test(175)=(min-min/10*10)+30h;
              prnumb=178;
              call print;
              errzx=55h;
              error=error+1;
           end;

end adlin;

main: R0=0;
   R0=0;
   R0=0;
   wsr=0h;
   call time(1000);
   w79=8h;
   w79=30h;
   w79=0dfh;
   ;
   call time(100)
   ;
   w79=89h;
   w79d=62h;
   ;
   disable;
   ;
   call time(1000);
   ;
   wsr=0;
   ; 
   int_pending=0;
   int_mask=0ach;
   ioc0=55h;
   ioc1=1h;
   hsi_mode=0ffh;
   hso_command=38h;
   t1=timer1;
   hso_time=t1+0a36bh;  
   call time(1000);
   num1=0h;
   num2=0h;
   num3=0h;
   fcung=0h;
   ii=0;  
   ms=0;
   ss=0;
   sec=0;
   min=0;
   hour=0;
   k=0;
   g=0;
   m=0;
   rebin=hour+1;
   zsd87=0dfh;
   zsd88=0ffh;
   zsd89=62h;
   pt8255=0h;
   fire=0h;
   error=0h;
   estep=0h;
   tem=0h;
   temp=0h;
   high1=0h;
   high2=0h;
   high3=0h;
   high4=0h;
   low1=0h;
   low2=0h;
   low3=0h;
   low4=0h;
   yj=0h;
   ysbj=0h;
   qdo=0;
   qd=0;
   ping=0;
   pingbi=0;
   lockn4=0;
   upp=0;
   latt=0h;
   latter=0h;
   err24=0h;
   err5=0h;
   ren7=0h;
   errbd=0h;
   errzx=0h;
   year1=1h;
   year2=9h;
   year3=9h;
   year4=8h;
   moun1=1h;
   moun2=1h;
   day1=1h;
   day2=6h;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -