Hi all
I trying to build a receiver with a pass code, a simple one .
The transmitter sends the code , and the receiver has dip switches to put the code .
I stuck on dip switches, how to put data from the switches? please help
here is a part of the code ,where I need help .
receive
btfss PIR1,RCIF; check for received data
goto receive
movf RCREG,W
ANDLW 0x0F ; mask out 4 upper bits
CALL CHK
BTFSS STATUS, Z ;
GOTO receive; keep recieving
PASS
BSF PORTA,7 ; pass ok
GOTO PASS
;--------------------------------
CHK
XORLW B'00000101' ; PASSCODE
RETURN
How put data from from the switches to PASSCODE
I have the switches on PORTA 0,1,2,3
Thank you
I trying to build a receiver with a pass code, a simple one .
The transmitter sends the code , and the receiver has dip switches to put the code .
I stuck on dip switches, how to put data from the switches? please help
here is a part of the code ,where I need help .
receive
btfss PIR1,RCIF; check for received data
goto receive
movf RCREG,W
ANDLW 0x0F ; mask out 4 upper bits
CALL CHK
BTFSS STATUS, Z ;
GOTO receive; keep recieving
PASS
BSF PORTA,7 ; pass ok
GOTO PASS
;--------------------------------
CHK
XORLW B'00000101' ; PASSCODE
RETURN
How put data from from the switches to PASSCODE
I have the switches on PORTA 0,1,2,3
Thank you