hi i made a relay driver i want some suggestions
heres the code
and here is the schematic
heres the code
Rich (BB code):
;RB0 controls RB7 and RA0
;RB0=0 then RB4 and RA0=0, else it will be 1 when RB0=1
;RB1 controls RB5 and RA1
;RB2 controls RB6 and RA2
;RB3 controls RB7 and RA3
list p=16F84A ; list directive to define processor
#include <p16F84A.inc> ; processor specific variable definitions
errorlevel -302, -207
__config _CP_OFF &_XT_OSC & _PWRTE_ON & _WDT_OFF
cntr1 equ h'21'
cntr2 equ h'22'
bfr1 equ 23h
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
ORG 0x004 ; interrupt vector location
nop
retfie ; return from interrupt
main:
bsf STATUS,RP0
movlw b'00000000'
movwf TRISA
movlw b'00001111'
movwf TRISB
bcf STATUS,RP0
newloop:
movf PORTB,W
movwf bfr1
movf bfr1,W
movwf PORTA
rlf bfr1,F
rlf bfr1,F
rlf bfr1,F
rlf bfr1,F
movf bfr1,W
movwf PORTB
goto newloop
end
and here is the schematic