Include
Page1 macro
bsf STATUS, RP0 ; page1
Endm
Page0 macro
bcf STATUS, RP0 ; page0
Endm
cbLOCK0ch
Time1, temp
Lo_val, hi_val, msn, lsn
Digit1, digit2
Count, read
Ssave, wsave
Flags
Endc
;===========================================
Org 00
Goto init
Org 04
btfss INTCON, T0IF
Goto end_int
MOV w, wsave
swapf STATUS, w
MOV w, ssave ; interrupt protection
Decf count, f
Decfsz read, f
Goto int2
Call adconv ; A/D conversion
MOV lw .16 ;
MOV w, read
int2 MOV f count, 0
btfsc STATUS, Z
Bsfflags, 0 ; eot
bcf INTCON, T0IF
End_int swapf ssave, w
MOV w, STATUS ;
Swap f wsave, f;
Swap f wsave, w
Retfie;
;==========Check the table ===============
table addwf PCL ; portb
Retlw '01110111' ; 0
Retlw '00010100' ; 1
Retlw '00111011' ; 2
Retlw '00111110' ; 3
Retlw '01011100' ; 4
Retlw '01101110' ; 5
Retlw '01101111' ; 6
Retlw '00110100' ; 7
Retlw '01111111' ; 8
Retlw '01111100' ; 9
Retlw 0
Retlw 0
Retlw 0
Retlw 0
Retlw 0
Retlw 0
Retlw 0
;*********************Temperature change******************
lookup addwf PCL
Retlw .99 ; 00
Retlw .99 ; 01
Retlw .99 ; 02
Retlw .99 ; 03
Retlw .91 ; 04
Retlw .81 ; 05
Retlw .73 ; 06
Retlw .66 ; 07
Retlw .59 ; 08
Retlw .52 ; 09
Retlw .45 ; 0A
Retlw .39 ; 0B
Retlw .31 ; 0C
Retlw .23 ; 0D
Retlw .13 ; 0E
Retlw .0 ; 0F
Retlw .0 ; catch for >f0h
;=========================================================
interp MOV f lsn, 0 ; initial value
Swap f lsn, w ; swap & save
MOV w, msn ; into w
MOV lw 0fh
Andw f lsn, f ; strip off upper rubbish
Andw f msn, f ; strip off upper rubbish
MOV f msn, 0 ; reload
Call lookup ; get value
MOV w, lo_val ; save it
Incf msn, w ; increment pointer
Call lookup ; get next value
Subw f lo_val, w ; get difference & save
MOV w, hi_val
Mult addwf hi_val, f ; add to current
Decf sz lsn, f ; countdown on multiply loop
Goto mult
Swap f hi_val, w ; divide by 16
Andl w 0fh ; extract upper nibble
Subw f lo_val, w ; add lo value to lo value to get result
Return
adconv bsf ADCON0, GO ; start conversion
MOV lw .5 ; wait delay 10uS
MOV w, temp
Decf sz temp, f ; loop for a while
Goto $-1
btfsc ADCON0, GO ; test for end of conversion
Goto $-1
Retlw 0
bin_bcd MOV w, digit1 ; first digit
Clr f digit2 ; second digit
tenlop MOV lw .10
Subw f digit1, w ; find out how many 10's
btfsc STATUS, C
Inc f digit2, f
btfsc STATUS, C
MOV w, digit1 ; remainder 1's left
btfsc STATUS, C
Goto tenlop
Return
;================================================
init clrf PORTB
clrf PORTA
clrf ADCON0
Clr f flags
Page1
MOV lw '11110011'
MOV w, TRISA
MOV lw '10000000' ;
MOV w, TRISB ; set port B
MOV lw '00000100' ; /32
MOV w, OPTION_REG
MOV lw '00000010'
MOV w, ADCON1
Page0
MOV lw '00001000' ; setup change of state on port B
MOV w, INTCON ; to wake up
Sleep ; shutdown
MOV lw '11000001' ; set A/D internal RC clock
; channel 0, A/D running
MOV w, ADCON0 ; do it
MOV lw .153 ; timeout value
MOV w, count
MOV lw .16 ; interval timer reload
MOV w, read
MOV lw '10100000' ; setup change of state on port B
MOV w, INTCON ; to wake up
Call adconv ; perform A/D conversion
;============================================================================
Main btfsc flags, 0 ; test for timeout
Goto init ; yes, so shutdown
MOV f ADRES, 0 ; load value
MOV w, lsn ; store for conversion
Call interp ; using interpolation method
Call bin_bcd ; convert into 2 digits
MOV f digit1, 0 ; load MSB
Call table ; convert into 7-segment format
MOV w, PORTB ; send to display
bsf PORTA, 2 ; enable character
btfss TMR0, 6 ; test bit
Goto $-1 ; loop
bcf PORTA, 2
MOV f digit2, 0 ; load LSB
Call table ; convert into 7-segment format
MOV w, PORTB ; send to display
bsf PORTA, 3 ; enable character
btfsc TMR0, 6 ; test bit
Goto $-1 ; loop
bcf PORTA, 3
Goto main
End
BLPS laser safety protective device is designed for personal safety used on hydraulic bender.
The dynamic test technology it used has passed the Type 4 functional safety assessment by TUV, and get the national invention patent. The product reaches the advanced technological level of similar products.
BLPS laser safety device provides protection zone near the die tip of the bender to protect fingers and arms of the operator in close to the upper mold die tip. It is the most effective solution so far to preserves the safety and productivity of the bender.
Press Brake Protection,Laser Guarding Device,Press Brake Guarding Systems,Press Brake Guarding
Jining Keli Photoelectronic Industrial Co.,Ltd , https://www.sdkelien.com