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

📄 guangfei.asm

📁 可用`Keil uVision2 软件编译
💻 ASM
📖 第 1 页 / 共 3 页
字号:
	         lcall Kdelay

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;small-motor run 周向定向
;;fu11_z_run:     cpl P0.4
               ;; call delays
	       ;; jb P3.1,fu11_runstop
	      ;;  jmp fu11_z_run
;;fu11_runstop:   lcall Kdelay
               ;; lcall Kdelay

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;dig-motor to post
                mov th0,#0h
                mov tl0,#0h
                setb  tr0
                mov 30h,#0ceh
fu11_dadaji:    mov 31h,#012h
fu11_dadaji1:   cpl P0.5
                call delay

                djnz 31h,fu11_dadaji1
                djnz 30h,fu11_dadaji
                clr tr0
                lcall Kdelay
                jmp dingchang

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;jmp_dingchang:      jmp   dingchang
;jmp_guo1:       jmp  ding_wj     ;无菲林   ;点动急停
;+++++++++++++++++++++++++++++++++++++++++++++++++++++
;mm/p=0.170196078431   lengh=1100mm

;+++++++++++++++++++++++++++++++++++++++++++++++++++++
LONG12:
fu12_waitwei:    jnb P2.4,fu12_weizhi
                 call delay
	         jmp fu12_waitwei
;^^^^^^^^^^^^^^^^^^^^^^^
;waiqigang----go out
fu12_weizhi:
                 call Kdelay
	         clr P3.2
		 setb tr0
	         call  Kdelay
;^^^^^^^^^^^^^^^^^^^^^^^^^
;slowp
fu12_btest:
fu12_btest1:      cpl P0.4
                  call delays
	          jb P3.0,fu12_slow_delay
	          jmp fu12_btest1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fu12_slow_delay:
                   mov 30h,#032h
fu12_slow_delay0:  mov 31h,#02fh
fu12_slow_delay1:  cpl P0.4
                   call delays
	           djnz 31h,fu12_slow_delay1
	           djnz 30h,fu12_slow_delay0
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;fast
               call intadd_p04
fu12_xiaodiji:
             cpl P0.4
             mov r2,th0
             mov r3,tl0
    	     call delayf
             cpl P0.4
             call delayf
             jb P2.2, jmp_guo2
             jnb P0.2,jmp_guo2
             jnb P2.3, jmp_ding_speaker2

	     cjne r3,#00h,panerr12
	     jmp hui12

panerr12:
             cjne r2,#0h,fu12_xiaodiji
	     cjne r3,#0ddh,fu12_xiaodiji
	     lcall  Kdelay
             jmp   kongjian_lo12
            ; jmp chong1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    jmp_guo2:           jmp  ding_wj
    jmp_ding_speaker2:  jmp ding_speaker
        hui12:               jmp cuokong
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       ;孔的检测,以导正菲林
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kongjian_lo12:     ;  mov 40h,#1eh
kongjian_lo12_er:     cpl P0.4
                      mov r2,th0
                      mov r3,tl0
                      lcall delay_1
                   ; jb P3.4,kongstop01_lo11
                     jb P2.2, jmp_guo2
                     jnb P0.2,jmp_guo2
                     jnb P2.3, jmp_ding_speaker2
                     cjne r2,#0h,kongjian_lo12_er
	             cjne r3,#0e6h,kongjian_lo12_er
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   kongstop_lo12:    lcall Kdelay
                      mov 30h,#050h
     kongstop2_lo12: cpl P0.5
                     lcall delay
                     djnz 30H,kongstop2_lo12
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
chong2:         lcall Kdelay
                mov th0,#0h
                mov tl0,#0h
                clr tr0
                clr P2.1
		setb P0.6
                clr P2.0
                lcall Kdelay
                setb P2.1
		clr P0.6
                setb P0.5
                lcall  Kdelay
		lcall  Kdelay
               ; setb P2.0
               ; jb 21h.2, sensor_re_jmp2
              ;  setb  tr0
              ;  mov th0,#0h
             ;   mov tl0,#0h
                jmp fu12_smallfn
;sensor_re_jmp1:  jmp sensor_re
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;small-motor houzhuan
fu12_smallfn:
                 mov 30h,#0c8h
fu12_houzhuan:   mov 31h,#0d2h
fu12_houzhuan1:  cpl P0.4
                 call delayf
                 cpl P0.4
                 call delayf
                 djnz 31h,fu12_houzhuan1
                 djnz 30h,fu12_houzhuan
                 lcall Kdelay
                 setb P3.2    ;qigang--go back
	         lcall Kdelay
	         lcall Kdelay

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;small-motor run 周向定向
;;fu12_z_run:     cpl P0.4
                ;;call delays
	        ;;jb P3.1,fu12_runstop
	       ;; jmp fu12_z_run

;;fu12_runstop:    lcall Kdelay
               ;; lcall Kdelay


;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;dig-motor to post
                mov th0,#0h
                mov tl0,#0h
                setb  tr0
                mov 30h,#0ceh
fu12_dadaji:    mov 31h,#012h
fu12_dadaji1:   cpl P0.5
                call delay

                djnz 31h,fu12_dadaji1
                djnz 30h,fu12_dadaji
                clr tr0
                lcall Kdelay

                jmp dingchang

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;mm/p=0.170196078431 lengh=1230mm    p=102X71=7568

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LONG13:
fu13_waitwei:    jnb P2.4,fu13_weizhi
                 call delay
	         jmp fu13_waitwei
;^^^^^^^^^^^^^^^^^^^^^^^
;waiqigang----go out
fu13_weizhi:
                 call Kdelay
	         clr P3.2
		 setb tr0
	         call  Kdelay
;^^^^^^^^^^^^^^^^^^^^^^^^^
;slowp
fu13_btest:
fu13_btest1:      cpl P0.4
                  call delays
	          jb P3.0,fu13_slow_delay
	          jmp fu13_btest1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fu13_slow_delay:
                   mov 30h,#032h
fu13_slow_delay0:  mov 31h,#02fh
fu13_slow_delay1:  cpl P0.4
                   call delays
	           djnz 31h,fu13_slow_delay1
	           djnz 30h,fu13_slow_delay0
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;fast
             call intadd_p04
fu13_xiaodiji:
             cpl P0.4
             mov r2,th0
             mov r3,tl0
    	     call delayf
             cpl P0.4
             call delayf
             jb P2.2, jmp_guo3
             jnb P0.2,jmp_guo3
             jnb P2.3, jmp_ding_speaker3

	     cjne r3,#00h,panerr13
	     jmp hui13

panerr13:
             cjne r2,#0h,fu13_xiaodiji
	     cjne r3,#0f9h,fu13_xiaodiji
	     lcall  Kdelay
             jmp   kongjian_lo13
            ; jmp chong1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    jmp_guo3:           jmp  ding_wj
    jmp_ding_speaker3:  jmp ding_speaker
        hui13:               jmp cuokong
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       ;孔的检测,以导正菲林
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kongjian_lo13:     ;  mov 40h,#1eh   ;给出6mm长若检测不出就跳出
kongjian_lo13_er:     cpl P0.4
                      mov r2,th0
                      mov r3,tl0
                     lcall delay_1
                   ; jb P3.4,kongstop01_lo11
                     jb P2.2, jmp_guo3
                     jnb P0.2,jmp_guo3
                     jnb P2.3, jmp_ding_speaker3
                     cjne r2,#01h,kongjian_lo13_er
	             cjne r3,#03h,kongjian_lo13_er
 ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      kongstop_lo13:    lcall Kdelay
                      mov 30h,#050h
     kongstop2_lo13: cpl P0.5
                     lcall delay
                     djnz 30H,kongstop2_lo13
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
chong3:         lcall Kdelay
                mov th0,#0h
                mov tl0,#0h
                clr tr0
                clr P2.1
		setb P0.6
                clr P2.0
                lcall Kdelay
                setb P2.1
		clr P0.6
                setb P0.5
                lcall  Kdelay
		lcall  Kdelay
               ; setb P2.0
               ; jb 21h.2, sensor_re_jmp2
              ;  setb  tr0
              ;  mov th0,#0h
             ;   mov tl0,#0h
                jmp fu13_smallfn
;sensor_re_jmp1:  jmp sensor_re
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;small-motor houzhuan
fu13_smallfn:
                 mov 30h,#0e2h   ;CEH
fu13_houzhuan:   mov 31h,#096h    ;BEH
fu13_houzhuan1:  cpl P0.4
                 call delayf
                 cpl P0.4
                 call delayf
                 djnz 31h,fu13_houzhuan1
                 djnz 30h,fu13_houzhuan
                 lcall Kdelay
                 setb P3.2    ;qigang--go back
	         lcall Kdelay
	         lcall Kdelay

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;small-motor run 周向定向
;;fu13_z_run:     cpl P0.4
               ;; call delays
	       ;; jb P3.1,fu13_runstop
	       ;; jmp fu13_z_run

;;fu13_runstop:    lcall Kdelay
               ;; lcall Kdelay


;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;dig-motor to post
                mov th0,#0h
                mov tl0,#0h
                setb  tr0
                mov 30h,#0ceh
fu13_dadaji:    mov 31h,#012h
fu13_dadaji1:   cpl P0.5
                call delay
                djnz 31h,fu13_dadaji1
                djnz 30h,fu13_dadaji
                clr tr0
                lcall Kdelay
                jmp dingchang
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;mm/p=0.168472515856 lengh=1288mm    p=55X139=7645
;不加减速后mm/p=0.1994374120956399   p=6382
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 LONG14:
fu14_waitwei:    jnb P2.4,fu14_weizhi
                 call delay
	         jmp fu14_waitwei
;^^^^^^^^^^^^^^^^^^^^^^^
;waiqigang----go out
fu14_weizhi:
                 call Kdelay
	         clr P3.2
		 setb tr0
	         call  Kdelay
;^^^^^^^^^^^^^^^^^^^^^^^^^
;slowp
fu14_btest:
fu14_btest1:      cpl P0.4
                  call delays
	          jb P3.0,fu14_slow_delay
	          jmp fu14_btest1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fu14_slow_delay:
                   mov 30h,#032h
fu14_slow_delay0:  mov 31h,#02fh
fu14_slow_delay1:  cpl P0.4
                   call delays
	           djnz 31h,fu14_slow_delay1
	           djnz 30h,fu14_slow_delay0
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;fast
             call intadd_p04
fu14_xiaodiji:
             cpl P0.4
             mov r2,th0
             mov r3,tl0
    	     call delayf
             cpl P0.4
             call delayf
             jb P2.2, jmp_guo4
             jnb P0.2,jmp_guo4
             jnb P2.3, jmp_ding_speaker4

	     cjne r3,#00h,panerr14
	     jmp hui14

panerr14:
             cjne r2,#01h,fu14_xiaodiji
	     cjne r3,#05h,fu14_xiaodiji
	     lcall  Kdelay
             jmp   kongjian_lo14
            ; jmp chong1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    jmp_guo4:           jmp  ding_wj
    jmp_ding_speaker4:  jmp ding_speaker
        hui14:               jmp cuokong
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

kongjian_lo14:     ;  mov 40h,#1eh
kongjian_lo14_er:     cpl P0.4
                      mov r2,th0
                      mov r3,tl0
                     lcall delay_1
                   ; jb P3.4,kongstop01_lo11
                     jb P2.2, jmp_guo4
                     jnb P0.2,jmp_guo4
                     jnb P2.3, jmp_ding_speaker4
                     cjne r2,#01h,kongjian_lo14_er
	             cjne r3,#0eh,kongjian_lo14_er

     kongstop_lo14:    lcall Kdelay
                      mov 30h,#050h
     ;kongstop1_lo14: mov 31H,#029H
     kongstop2_lo14: cpl P0.5
                     lcall delay
                  ;   djnz 31H,kongstop2_lo14
                     djnz 30H,kongstop2_lo14
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
chong4:          lcall Kdelay
                mov th0,#0h
                mov tl0,#0h
                clr tr0
                clr P2.1
		setb P0.6
                clr P2.0
                lcall Kdelay
                setb P2.1
		clr P0.6
                setb P0.5
                lcall  Kdelay
		lcall  Kdelay
               ; setb P2.0
               ; jb 21h.2, sensor_re_jmp2
              ;  setb  tr0
              ;  mov th0,#0h
             ;   mov tl0,#0h
                jmp fu14_smallfn
;sensor_re_jmp1:  jmp sensor_re
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;small-motor houzhuan
fu14_smallfn:
                 mov 30h,#0ceh
fu14_houzhuan:   mov 31h,#0ach
fu14_houzhuan1:  cpl P0.4
                 call delayf
                 cpl P0.4
                 call delayf
                 djnz 31h,fu14_houzhuan1
                 djnz 30h,fu14_houzhuan
                 lcall Kdelay
                 setb P3.2    ;qigang--go back
	         lcall Kdelay
	         lcall Kdelay

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;small-motor run 周向定向
;;fu14_z_run:     cpl P0.4
               ;; call delays
	       ;; jb P3.1,fu14_runstop
	       ;; jmp fu14_z_run

;;fu14_runstop:    lcall Kdelay
           ;;     lcall Kdelay


;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;dig-motor to post
                mov th0,#0h
                mov tl0,#0h
                setb  tr0
                mov 30h,#0ceh
fu14_dadaji:    mov 31h,#012h
fu14_dadaji1:   cpl P0.5
                call delay
                djnz 31h,fu14_dadaji1
                djnz 30h,fu14_dadaji
                clr tr0
                lcall Kdelay
                jmp dingchang
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;mm/p=0.1681398252184       lengh=1350mm   p=146X55=8030(8029)
;0.213869836

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 LONG15:
fu15_waitwei:    jnb P2.4,fu15_weizhi
                 call delay
	         jmp fu15_waitwei
;^^^^^^^^^^^^^^^^^^^^^^^
;waiqigang----go out
fu15_weizhi:
                 call Kdelay
	         clr P3.2
		 setb tr0
	         call  Kdelay
;^^^^^^^^^^^^^^^^^^^^^^^^^
;slowp
fu15_btest:
fu15_btest1:      cpl P0.4
                  call delays
	          jb P3.0,fu15_slow_delay
	          jmp fu15_btest1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fu15_slow_delay:
                   mov 30h,#032h
fu15_slow_delay0:  mov 31h,#02fh
fu15_slow_delay1:  cpl P0.4
                   call delays
	           djnz 31h,fu15_slow_delay1
	           djnz 30h,fu15_slow_delay0
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;fast
fu15_xiaodiji:
             cpl P0.4
             mov r2,th0
             mov r3,tl0

⌨️ 快捷键说明

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