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

📄 printer.mac

📁 calculator code ,use toshibaor nec LSI
💻 MAC
📖 第 1 页 / 共 5 页
字号:
ltp_timer_y_init:
		inc	(STEP_CT)
		cmp	(STEP_CT),16
		j	lt,ltp_timer_y_i2
		j	ne,ltp_timer_y_i0
		@CLB	(F_RVSE)
		j	ltp_timer_y_i2
ltp_timer_y_i0:
		cmp	(STEP_CT),34
		j	lt,ltp_timer_y_i2
		@CLB	(F_INIT)		;== complete init ==
		j	ltp_timer_y_rush	;---> Motor stop Rush
ltp_timer_y_i2:
		call	phase_out
		@T2_SET (STP_FEED_LTP)		;set step MT pulse length for intialize
		@T2_START			;timer2 start with 0.5us clock
		j	timer_y_exit

;
;--------------------------------------------------------------------------------------
timer_y_feed:
		inc	(STEP_CT)
		ld	b,(STEP_CT)
;V3.09		@BBS	(SW_LTP,ltp_timer_y_feed)	;V3.08
		cmp	b,20+1			;10 dotline complete?
;V3.09		jp	ltp_timer_y_feed_1		;V3.08
ltp_timer_y_feed:
;V3.09		cmp	b,40+3+(L_FEED_LTP*2)+1			;V3.08
ltp_timer_y_feed_1:
		j	lt,timer_y_f10		;no
		@BBS	(F_FDREQ,timer_y_f01)	;---> continuous feed request?  yes->
		@CLB	(F_FEED)		;== complete feed ==
		@BBS	(SW_LTP,ltp_timer_y_rush)	;LTP8235 printer?  yes->
		j	timer_y_rush		;---> Motor stop Rush
timer_y_f01:
		ld	(STEP_CT),1
		ld	b,234			;= STEP_CT
		j	timer_y_f22
timer_y_f10:
;V3.09		@BBS	(SW_LTP,timer_y_f10x)	;V3.08
		cmp	b,16+1			;8 dotline complete ?
		jp	timer_y_f10y
timer_y_f10x:
;V3.09		cmp	b,(40+3+(L_FEED_LTP*2)+1)*4/5	;V3.08
timer_y_f10y:
		j	ne,timer_y_f22		;no
		@CLB	(F_FDREQ)		;== near to complete feed ==
timer_y_f22:
;V4.16		j	ltp_timer_y_fed		;//test
		@BBS	(SW_LTP,ltp_timer_y_fed)	;LTP8235 printer?  yes->
		cmp	b,1			;STEP_CT=1 ?
		j	ne,timer_y_f25		;no
		@T2_SET (STP_SLOW)		;set step MT pulse length for slow up
		j	timer_y_f30
timer_y_f25:
		@T2_SET (STP_FEED)		;set step MT pulse length for normal feed step
timer_y_f30:
		@T2_START			;timer2 start with 0.5us clock
timer_y_f39:
		call	phase_out
		j	timer_y_exit

ltp_timer_y_fed:
		@T2_SET (STP_FEED_LTP)		;set step MT pulse length for normal feed step
		@T2_START			;timer2 start with 0.5us clock
		j	timer_y_f39
;
;--------------------------------------------------------------------------------------
timer_y_prn:
		;--------------------------------------------------------------
		@BBS	(SW_LTP,ltp_timer_y_prn)	;LTP8235 printer?  yes->
		@BBC	(F_RVSE,timer_y_p00)
		inc	(STEP_CT)
		cmp	(STEP_CT),43		;21dot x2 step?
		j	lt,timer_y_p20
		@CLB	(F_RVSE)
		inc	(PHASE_CT)
		ld	(STEP_CT),0
		j	timer_y_rush	
		;--------------------------------------------------------------
timer_y_p00:
;		cmp	(STEP_CT),40+12		;20+6 dotline complete ?
		@BBS	(F_LPRN,timer_y_p00x0)	;V4.07
		@BBS	(F_LARGP,timer_y_p00x)		;V4.03
timer_y_p00x0:					;V4.07
		cmp	(STEP_CT),40+6+L_FEED	;20+n dotline complete ?
		jp	timer_y_p00y			;V4.03
timer_y_p00x:
		cmp	(STEP_CT),40+6+L_FEED+12	;V4.03 20+n dotline complete ?
timer_y_p00y:						;V4.03
		j	lt,timer_y_p08		;no
timer_y_p01:
;V4.07		@CLB	(F_LPRN)		;V4.07
;V3.00		@BBS	(RP_PRINT,timer_y_p012)	;auto replay print? yes-> no reverse mortion
		@BBC	(F_REVCAN,timer_y_p015)	;if reverse cancel flag on(durring TAX- FC MU D%) -> cancel reverse action
timer_y_p012:
		@BBS	(F_PRREQ,timer_y_p05)	;
		j	timer_y_p017		;
timer_y_p015:
		@BBC	(F_EXFED,timer_y_p02)
;		cmp	(STEP_CT),40+12+42	;20+6+21
		@BBS	(F_LPRN,timer_y_p015x0)	;V4.07
		@BBS	(F_LARGP,timer_y_p015x)		;V4.03
timer_y_p015x0:					;V4.07
		cmp	(STEP_CT),40+6+L_FEED+42	;20+6+21
		jp	timer_y_p015y			;V4.03
timer_y_p015x:						;V4.03
		cmp	(STEP_CT),40+6+L_FEED+42+12	;V4.03
timer_y_p015y:						;v4.03
		j	lt,timer_y_p03
		;--------------------------------------------------------------
timer_y_p017:				;1 line completed with feeding 1 line
		@CLB	(F_EXFED)
		@CLB	(F_PRINT)
;V4.07		@CLB	(F_LARGP)	;V4.03
		@CLB	(F_LPRN)	;V4.07
		ld	(STEP_CT),0
		j	timer_y_rush		;---> Motor stop Rush
		;--------------------------------------------------------------
timer_y_p02:
		@BBS	(F_PRREQ,timer_y_p05)	;request continuous print  yes->
		@BBS	(F_REVCAN,timer_y_p03)	;if reverse cancel flag on(durring TAX- FC MU D%) -> cancel reverse action
		@SEB	(F_EXFED)
		@SEB	(F_RVREQ)
timer_y_p03:
		inc	(STEP_CT)
		j	timer_y_p50
		;--------------------------------------------------------------
timer_y_p05:				;1 line completed without feeding 1 line.
		ld	(STEP_CT),0	
;V4.07		@CLB	(F_LARGP)	;V4.06
		@CLB	(F_LPRN)	;V4.07
		j	timer_y_p20
		;--------------------------------------------------------------
timer_y_p08:
		@BBC	(F_STBON,timer_y_p10)	;complete output previouse strobe?  yes->
		@SEB	(F_STBDLY)		;not yet --> start chopping
		j	timery_add		;---> Add to step_time
timer_y_p10:
		inc	(STEP_CT)
;V4.05		ld	a,(STEP_CT)
;V4.05		cmp	a,7
		cmp	(STEP_CT),7	;V4.05
		j	lt,timer_y_p20		;from start step to step6  yes-> no print
		@BBS	(F_LPRN,timer_y_p10z)	;V4.07
		@BBS	(F_LARGP,timer_y_p10x)	;V4.03
timer_y_p10z:
;V4.05		cmp	a,7+40			;
		cmp	(STEP_CT),7+40	;V4.05
		j	lt,timer_y_p40	;V4.07
		j	ne,timer_y_p50	;v4.07
		@CLB	(F_PRREQ)	;V4.07
		@SEB	(F_LPRN)	;V4.07
		jp	timer_y_p50	;V4.07
;V4.07		jp	timer_y_p10y		;V4.03
timer_y_p10x:
;V4.05		cmp	a,7+40+12		;V4.03
		cmp	(STEP_CT),7+40+12	;V4.05
timer_y_p10y:					;V4.03
		j	lt,timer_y_p40		;step7 to step46?  yes-> print
		j	ne,timer_y_p50		;last step?  no->
		@CLB	(F_PRREQ)		;== complete printing ==
		@CLB	(F_LPRN)	;V4.07
;V4.07		@CLB	(F_LARGP)	;V4.06

;V4.06		j	timer_y_p50		;

timer_y_p20:
		j	timer_y_p50

;print out................
timer_y_p40:
		call	strobe_cont
timer_y_p50:
		call	phase_out		;MT STEP output
		call	next_step_set		;
;;		@AD_VPR				;A/D convert(VPR) start
timer_y_exit:
		@POP_REG
		reti
;
timer_y_rush:
		@SEB	(F_RUSH)		;start rush step
		@T2_SET (STP_RUSH)		;set step MT pulse length for rush step
		@T2_START			;timer2 start with 0.5us clock
		j	timer_y_exit
;V3.13;
;-------------------------------------------------------------------
phase_tbl:
;		    IN2 IN1 ENA1&2   
;		     |	  \  ||  
;		      \	__ \|||  
;		          \ |||      
;		           ||||
;			   PPPP
;			   4444
;			   6543
		db	0y00011000	;step1
		db	0y00111000	;step2
		db	0y01111000	;step3
		db	0y01011000	;step4
;
phase_out:
;V3.00		@BBS	(SW_LTP,ltp_phase_out)	;LTP8235 printer?  yes->
		ld	a,(PHASE_CT)
		and	a,0y00000011
		ld	c,a
		ld	hl,phase_tbl
		@BBC	(SW_LTP,phase_out_1)
		ld	hl,ltp_phase_tbl
phase_out_1:
		ld	a,(P4DR)
		and	a,0y00000100			;AIN1,AIN0 must set '0' for AD convert
		or	a,(hl+c)
		ld	(P4DR),a
		@BBS	(F_RVSE,phase_out_9)
		inc	(PHASE_CT)
		ret
phase_out_9:
		dec	(PHASE_CT)
		ret

;-------------------------------------------------------------------
ltp_phase_tbl:
;		    IN2 IN1 ENA2&1   
;		     |	  \  ||  
;		      \	__ \ ||  
;		          \ |||      
;		           ||||
;			   PPPP
;			   4444
;			   6543
		db	0y01011000	;step4
		db	0y01111000	;step3
		db	0y00111000	;step2
		db	0y00011000	;step1

;V3.00ltp_phase_out:
;V3.00		ld	a,(PHASE_CT)
;V3.00		and	a,0y00000011
;V3.00		ld	c,a
;V3.00		ld	hl,ltp_phase_tbl
;V3.00		ld	a,(P4DR)
;V3.00		and	a,0y00000100			;AIN1,AIN0 must set '0' for AD convert
;V3.00		or	a,(hl+c)
;V3.00		ld	(P4DR),a
;V3.00		@BBS	(F_RVSE,ltp_phase_out_9)
;V3.00		inc	(PHASE_CT)
;V3.00		ret
;V3.00ltp_phase_out_9:
;V3.00		dec	(PHASE_CT)
;V3.00		ret

;
next_step_set:
		@BBS	(SW_LTP,ltp_next_step)	;LTP8235 printer?  yes->
		ld	a,(STEP_CT)
		cmp	a,2		;Step_1 ?
		j	ge,next_stp2	;no
		cmp	a,1
		j	eq,next_stp6	;
		ld	(STEP_CT),1
		j	next_stp5	;
next_stp2:
		@BBC	(F_STBDLY,next_stp5)
		ld	wa,(STB_BAK)
		cmp	wa,STP_SLOW_CMP		;previouse strobe length is shorter than slow step?
		j	lt,next_stp5
next_stp6:
		@T2_SET (STP_SLOW)		;set step MT pulse length for slow up
		j	next_stp8
next_stp5:
		@T2_SET (STP_NORM)		;set step MT pulse length for normal step
next_stp8:
		@T2_START			;timer2 start with 2 clock
		@CLB	(F_STBDLY)
		ret

ltp_next_step:
		@BBC	(F_ACC,ltp_next_stp5)	;under accelaration controle?  no->
		ld	a,(STEP_CT)
		cmp	a,4
		j	gt,ltp_next_stp5
		j	ne,ltp_next_stp2
		@CLB	(F_ACC)
		ld	a,(STEP_CT)
ltp_next_stp2:
		shlc	a
		ld	c,a
		ld	hl,ltp_acc_tbl
		ld	wa,(hl+c)
		ld	(TC2DRL),wa		;accelaration step set to timer2
		j	ltp_next_stp8
ltp_next_stp5:
		@T2_SET (STP_NORM_LTP)		;set step MT pulse length for normal step
		ld	wa,STP_NORM_LTP
ltp_next_stp8:
		add	wa,STP_NORM_ADJ
		shlca	wa			;x2
		ld	(STEP_BAK),wa		;MT step back up for calculate 'C' parameater of STB pulse (LTP8235)
		@T2_START			;timer2 start with 2 clock
		@CLB	(F_STBDLY)
		ret


strobe_cont:
		@AD_VPR				;A/D convert(VPR) start
		ld	cf,(STEP_CT).0		;even step?
		j	cc,stbc_51		;yes -> 
		@LATCH				;data latch for printer head
		@CLB	(F_BHLD)		;release shift register
		@CLB	(F_SSTB)		;STB1+STB2 output
		cmp	(DOT_CT),144		;print 2 times?//TEST
		j	lt,stbc_51		;no ->//TEST
		@SEB	(F_SSTB)		;only STB1 output//TEST
stbc_51:
		@GET_AD				;AD value(VPRN) -> reg.a
		ld	(VPRN),a

		@BBS	(SW_LTP,ltp_stb_cont)	;LTP8235 printer?  yes->
		ld	a,(VPRN)
		cmp	a,152

⌨️ 快捷键说明

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