Programmable Package SG-8018CA(SG7050C) - 0.67M to 170M
High Brightness LED Lamp Bead Patch Lighting Products - 0805 White Light Indicator
; Include the standard PIC12C509A register definitions
#include "P12c509a.inc"
__CONFIG _CP_OFF & _WDT_ON & _INTOSC_OSC
; Define pin assignments
DCC_on equ 0
Ovl_in equ 1
Relay equ 2
Ovl_out equ 4
; Define memory variables
CBLOCK 0x0007
State ; state sequence
Time0 ; counter 0
Time1 ; counter 1
Time2 ; counter 2
ENDC
ORG 0
MOVwf OSCCAL ; set oscillator calibration
bcf STATUS, PA0
MOVlw B'10001111'
OPTION
; Set port directions and initial values
; GP0: DCC control (high is on)
; GP1: Overload input (active low)
; GP2: Reverse output
; GP4: Overload output (high is overload)
MOVlw B'00000010'
TRIS GPIO
MOVlw B'00000001' ; set ports
MOVwf GPIO
Clrf State
; Main loop starts here
; Scans for high in overload input
Test clrwdt
btfss GPIO, Ovl_in ; check for overload
Goto set1
Test1 btfsc State, 0 ; check state
Goto caltim ; reset delay
Goto test ; check again
; If overload detected
set1 bcf GPIO, DCC_on ; turn off
Btfsc State, 0 ; if first time after reset
Goto state1
Bsf State, 0 ; set to state 1
MOVf GPIO, W ; get port settings
xorlw B'00000100' ; reverse relay
MOVwf GPIO
Call delay25 ; delay 25 ms for relay
Bsf GPIO, DCC_on ; turn back on
Goto test ; check for overload
state1 Bsf GPIO, Ovl_out ; set alarm
Call del500
Bsf State, 7 ; set timeout
Bcf GPIO, Ovl_out ; turn off alarm
Bsf GPIO, DCC_on ; output on
Goto test
caltim Call timeout ; reset timer
Goto test
delay
MOVlw 0xFF ; short delay
MOVwf Time0
delay1 clrwdt
Nop
Nop
Decfsz Time0, F
Goto delay1
Retlw 0
dely25
clrwdt
MOVlw .30 ; 25 milliseconds
MOVwf Time1
dely25a
MOVlw 0xFF
MOVwf Time2
dely25b
Decfsz Time2, F
Goto dely25b
Decfsz Time1, F
Goto dely25a
Retlw 0
del500
MOVlw 0xFF ; 500 milliseconds
MOVwf Time1
del500a
MOVlw 0xFF
MOVwf Time2
del500b
clrwdt
Nop
Nop
Nop
Nop
Decfsz Time2, F
Goto del500b
Decfsz Time1, F
Goto del500a
Retlw 0
timeout
btfss State, 7 ; continue countdown
Goto countdn
MOVlw 0xFF ; set counters
MOVwf Time1
timo2
MOVlw 0xFF
MOVwf Time2
Bcf State, 7
countdn
Decfsz Time2, F
Retlw 0
Decfsz Time1, F
Goto timo3
Clrf State ; reset
Retlw 0
timo3
MOVlw 0xFF
MOVwf Time2
Retlw 0
End
Electrical Wiring Harness
The typical Electrical Wire harnesses that ETOP supplies include dozens of wires and sometimes hundreds of different components and terminations. Our engineering staff is well versed in the design and construction of wire harnesses and is available to assist in the development of the most efficient wiring harness to meet your demands. A basic Wire Harness may include as few as three discreet components, while the more classic harnesses include many more wires and other passive, and potentially active, components.
Electrical Wiring Harness, terminal wiring, wire assembling,bullet terminals, lead wire assembly
ETOP WIREHARNESS LIMITED , https://www.etopwireharness.com