📄 printer_415
字号:
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
;V4.15 cmp (DOT_CT),144 ;print 2 times?//TEST
;V4.15 j lt,stbc_51 ;no ->//TEST
;V4.15 @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
j ge,stbc_ad0
ld a,152
j stbc_ad2
stbc_ad0:
cmp a,212
j lt,stbc_ad2
ld a,212
stbc_ad2:
;V4.04 ld d,(HD_TEMP)
;V4.04 shrc d ;;V4.02 d=(HD_TEMP)/2
;V4.04 ld e,32*2 ;32word * 2bytes pre each data block
;V4.04 mul d,e
;V4.04 add de,stb_pulse_tbl
;V4.05 ld de,(HD_TEMP) ;V4.04
sub a,152
;V4.04 inc a
;V4.04 and a,0y00111100
shrc a ;V4.04
shrc a ;V4.04
shlc a ;V4.04
ld w,0 ;V4.05
;V4.05 ld hl,power_table ;V4.04
add wa,power_table ;V4.05
;V4.05 ld c,a ;V4.04
;V4.05 ld wa,(hl+c) ;V4.04 wa=lg(Qv)
ld de,wa ;V4.05
ld wa,(de) ;V4.05
ld de,(HD_TEMP) ;V4.05
;V4.05 and wa,0xf000 ;V4.04
;V4.05 j eq,stbc_ad3 ;V4.04
;V4.05 ld wa,(hl+c) ;V4.04 wa=lg(Qv)
;V4.05 and wa,0x0fff ;v4.04
;V4.05 sub de,wa ;V4.04
stbc_ad3:
add de,wa ;V4.04 wa=lg(Pt)+lg(Qv)
stbc_ad4:
ld wa,de ;v4.04
sub wa,2849 ;V4.04 2849 is the mininum data
shlca wa ;V4.04
shlca wa ;V4.04
;v4.05 ld de,stb_pulse_tbl;V4.04
ld de,wa ;V4.05
;V4.04 ld b,a
@BBC (F_SSTB,stbc_70) ;2 times print? no->
;V4.04 inc b
;V4.04 inc b
;V4.05 inc wa ;V4.04
;V4.05 inc wa ;V4.04
inc de ;V4.05
inc de ;V4.05
stbc_70:
;V4.04 ld a,b
;V4.04 ld w,0
;V4.05 add de,wa
add de,stb_pulse_tbl ;V4.05
ld wa,(de)
ld (STB_BAK),wa
@T1_SET ;reg.wa -> TREG1A
@T1_START
@BBC (F_SSTB,stbc_80) ;---> 2times print? no->
@STB1_TRG ;1/2 dot print
@STB2_OFF
j stbc_90
stbc_80:
@STB1_TRG ;all dot print
@STB2_TRG ;
stbc_90:
@SEB (F_STBON) ;under strobe output
ret
;
ltp_stb_cont:
call stb_calc
ld (STB_BAK),wa
@T1_SET ;reg.wa -> TREG1A
@T1_START
@BBC (F_SSTB,ltp_stbc_80) ;---> 2times print? no->
@STB1_TRG ;1/2 dot print
@STB2_OFF
j ltp_stbc_90
ltp_stbc_80:
@STB1_TRG ;all dot print
@STB2_TRG ;
ltp_stbc_90:
@SEB (F_STBON) ;under strobe output
ret
;for LTP8235............................................................................................
ltp_timer_y_prn:
cmp (STEP_CT),40+3+(L_FEED_LTP*2) ;20+1+(feed line) dotline complete ?
j lt,ltp_timer_y_p08 ;no
@BBS (F_PRREQ,ltp_timer_y_p05) ;
@CLB (F_PRINT)
ld (STEP_CT),0
j ltp_timer_y_rush ;---> Motor stop Rush
ltp_timer_y_p05:
ld (STEP_CT),0
j ltp_timer_y_p10
ltp_timer_y_p08:
@BBC (F_STBON,ltp_timer_y_p10) ;complete output previouse strobe? yes->
@SEB (F_STBDLY) ;not yet --> start chopping
j timery_add ;---> Add to step_time
ltp_timer_y_p10:
inc (STEP_CT)
ld a,(STEP_CT)
cmp a,3
j lt,ltp_timer_y_p20 ;
cmp a,3+40 ;
j lt,ltp_timer_y_p40 ;step3 to step42? yes-> print
j ne,ltp_timer_y_p50 ;last step? no->
@CLB (F_PRREQ) ;== complete printing ==
j ltp_timer_y_p50 ;
ltp_timer_y_p20:
ld wa,0
ld (STB_BAK),wa ;for calculation "C" parameater
j ltp_timer_y_p50
;print out................
ltp_timer_y_p40:
call strobe_cont
ltp_timer_y_p50:
call phase_out ;MT STEP output
call next_step_set ;
j timer_y_exit
ltp_timer_y_rush:
@SEB (F_RUSH) ;start rush step
@T2_SET (STP_STOP_LTP) ;set step MT pulse length for wake up step
@T2_START16 ;timer2 start with 16us clock
j timer_y_exit
;
;==============================================================================
; Timer-1 Interrupt (turn off strobe pulse)
;==============================================================================
tm1_int:
@PUSH_REG
@T1_STOP
@STB1_OFF
@CHK_STB2_OFF (timer_x10) ;STB2 still off? yes-> output STB2
@STB2_OFF
@CLB (F_STBON)
@BBS (F_STBDLY,timer_x9)
jp timer_x11
timer_x9:
@PHASE_ON ;phase ON(MT driver enable)
@T2_STOP
j ltp_timer_y_p10 ;//TEST
@BBS (SW_LTP,ltp_timer_y_p10) ;LTP8235 printer? yes->
j timer_y_p10 ;---> strobe controle, next step set
timer_x10:
@STB2_TRG ;ON
@PHASE_ON ;phase ON(MT driver enable)
ld wa,(STB_BAK)
@T1_SET ;reg.wa -> TREG1A
@T1_START
ld wa,(STB_BAK)
shlca wa ; *2
ld (STB_BAK),wa
timer_x11:
@POP_REG
reti
;------------------------------------------------------------------------------------
;V4.04===============================================================================
; Voltage AD
power_table: ;=1000*lg(Qv) ;V4.04
; 5.938 6.094 6.25 6.406 6.563 6.719 6.875 7.031
;dw 322 296 270 245 218 192 166 141
dw 0x0142, 0x0128, 0x010e, 0x00f5, 0x00da, 0x00c0, 0x00a6, 0x008d
; 7.188 7.384 7.5 7.656 7.813 7.969 8.125 8.281
;dw 116 85 67 45 24 4 -14 -30
dw 0x0074, 0x0055, 0x0043, 0x002d, 0x0018, 0x0004, 0xfff2 ,0xffe2
;-----------------------------------------------------------------------------------
;V4.04==============================================================================
; Temp. AD index
temp_table: ;=1000*lg(Pt) ;V4.04
dw 2879 ;V4.04 db 64 ;0
dw 2884 ;V4.04 db 63 ;1
dw 2889 ;V4.04 db 62 ;2
dw 2893 ;V4.04 db 61 ;3
dw 2898 ;V4.04 db 60 ;4
dw 2902 ;V4.04 db 59 ;5
dw 2906 ;V4.04 db 58 ;6
dw 2911 ;V4.04 db 57 ;7
dw 2915 ;V4.04 db 56 ;8
dw 2919 ;V4.04 db 55 ;9
dw 2923 ;V4.04 db 54 ;10
dw 2927 ;V4.04 db 53 ;11
dw 2929 ;V4.04 db 53 ;12
dw 2931 ;V4.04 db 52 ;13
dw 2936 ;V4.04 db 51 ;14
dw 2939 ;V4.04 db 50 ;15
dw 2943 ;V4.04 db 49 ;16
dw 2947 ;V4.04 db 48 ;17
dw 2949 ;V4.04 db 48 ;18
dw 2951 ;V4.04 db 47 ;19
dw 2955 ;V4.04 db 46 ;20
dw 2959 ;V4.04 db 45 ;21
dw 2963 ;V4.04 db 44 ;22
dw 2964 ;V4.04 db 44 ;23
dw 2966 ;V4.04 db 43 ;24
dw 2970 ;V4.04 db 42 ;25
dw 2974 ;V4.04 db 41 ;26
dw 2977 ;V4.04 db 40 ;27
dw 2980 ;V4.04 db 40 ;28
dw 2984 ;V4.04 db 39 ;29
dw 2990 ;V4.04 db 38 ;30
dw 2996 ;V4.04 db 37 ;31
dw 2999 ;V4.04 db 37 ;32
dw 3002 ;V4.04 db 36 ;33
dw 3008 ;V4.04 db 35 ;34
dw 3013 ;V4.04 db 34 ;35
dw 3019 ;V4.04 db 33 ;36
dw 3022 ;V4.04 db 33 ;37
dw 3025 ;V4.04 db 32 ;38
dw 3030 ;V4.04 db 31 ;39
dw 3036 ;V4.04 db 30 ;40
dw 3039 ;V4.04 db 30 ;41
dw 3041 ;V4.04 db 29 ;42
dw 3047 ;V4.04 db 28 ;43
dw 3052 ;V4.04 db 27 ;44
dw 3055 ;V4.04 db 27 ;45
dw 3057 ;V4.04 db 26 ;46
dw 3063 ;V4.04 db 25 ;47
dw 3068 ;V4.04 db 24 ;48
dw 3073 ;V4.04 db 23 ;49
dw 3075 ;V4.04 db 23 ;50
dw 3078 ;V4.04 db 22 ;51
dw 3083 ;V4.04 db 21 ;52
dw 3088 ;V4.04 db 20 ;53
dw 3093 ;V4.04 db 19 ;54
dw 3097 ;V4.04 db 18 ;55
dw 3100 ;V4.04 db 18 ;56
dw 3102 ;V4.04 db 17 ;57
dw 3107 ;V4.04 db 16 ;58
dw 3111 ;V4.04 db 15 ;59
dw 3116 ;V4.04 db 14 ;60
dw 3121 ;V4.04 db 13 ;61
dw 3125 ;V4.04 db 12 ;62
dw 3130 ;V4.04 db 11 ;63
dw 3134 ;V4.04 db 10 ;64
dw 3138 ;V4.04 db 9 ;65
dw 3143 ;V4.04 db 8 ;66
dw 3147 ;V4.04 db 7 ;67
dw 3151 ;V4.04 db 6 ;68
dw 3155 ;V4.04 db 5 ;69
dw 3160 ;V4.04 db 4 ;70
dw 3164 ;V4.04 db 3 ;71
dw 3168 ;V4.04 db 2 ;72
dw 3172 ;V4.04 db 1 ;73
dw 3176 ;V4.04 db 0 ;74
;==========================================================
stb_pulse_tbl:
;V4.04===============================================================================================
; PLS=PT*Qv*Qs
; Pt=-13.5*T+1500 (0<T<40) Pt=-8*T+1270 (40<T<60)
; Qv=0.125*Vh^2-2.275*Vh+11.2
; Qs=1.1*lg(STL1/1000)+0.756
; STL1=STL <144dot:(Pt*Qt+Qt<SLT=1667),>144dot:(Pt*Qt*2+Qt<SLT=1667)
; STL1=Pt*Qv+Qt <144dot:(Pt*Qv+Qt>SLT=1667),>144dot:(Pt*Qv*2+Qt>SLT=1667)
;so PLS=F{lg(Pt)+lg(Qt)}, F: it's a function
; and 2849<=lg(Pt)+lg(Qv)<=3498
; integer of PLS PLS/<144 PLS/>144 lg(Pt*Qv)] Pt*Qv Qs/<144 Qs/>144 item
dw 706,706 ;706.4087821 706.4087821 2.849 706.3175543 1.00012916 1.00012916 1
dw 708,708 ;708.0372225 708.0372225 2.850 707.9457844 1.00012916 1.00012916 2
dw 709,709 ;709.6694169 709.6694169 2.851 709.577768 1.00012916 1.00012916 3
dw 711,711 ;711.3053739 711.3053739 2.852 711.2135137 1.00012916 1.00012916 4
dw 712,712 ;712.9451021 712.9451021 2.853 712.8530301 1.00012916 1.00012916 5
dw 714,714 ;714.5886103 714.5886103 2.854 714.4963261 1.00012916 1.00012916 6
dw 716,716 ;716.2359072 716.2359072 2.855 716.1434102 1.00012916 1.00012916 7
dw 717,717 ;717.8870014 717.8870014 2.856 717.7942913 1.00012916 1.00012916 8
dw 719,719 ;719.5419019 719.5419019 2.857 719.448978 1.00012916 1.00012916 9
dw 721,721 ;721.2006173 721.2006173 2.858 721.1074792 1.00012916 1.00012916 10
dw 722,722 ;722.8631564 722.8631564 2.859 722.7698036 1.00012916 1.00012916 11
dw 724,724 ;724.5295281 724.5295281 2.860 724.4359601 1.00012916 1.00012916 12
dw 726,726 ;726.1997411 726.1997411 2.861 726.1059574 1.00012916 1.00012916 13
dw 727,727 ;727.8738044 727.8738044 2.862 727.7798045 1.00012916 1.00012916 14
dw 729,729 ;729.5517268 729.5517268 2.863 729.4575103 1.00012916 1.00012916 15
dw 731,731 ;731.2335173 731.2335173 2.864 731.1390835 1.00012916 1.00012916 16
dw 732,732 ;732.9191846 732.9191846 2.865 732.8245331 1.00012916 1.00012916 17
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -