J
Jason
Guest
I am kinda new to this and was wondering if someone could help me out. I
have the following lines of code:
CheckNumber btfss PIR1,RCIF ;Check to see a transmission has been made!!
goto CheckNumber
movf RCREG,w
call EE_Read ;Sets w in 0x00 of EEPROM
SUBLW RCREG
btfsc STATUS,Z ;If true then run next line
goto oknum1
goto receive
oknum1 bcf STATUS, RP0 ; Bank 0
movlw 'o'
call send
movlw 'k'
call send
movlw '1'
call send
Whats not working is my SUBLW RCREG. call EE_Read is returning a number
that is store on the chip and pushing that into w. I need to compare w to
what is in my RCREG which should be a single byte of data from the serial
port. I can do something like SUBLW '3' to see if w is equal to 3 which
works fine but the other way doesn't. Is there a way to convert REREG to a
literal to compare it to w and see if they are equal? I have tried serveral
things including declaring a variable and trying - movf RCREG,TempVar and
then comparing TempVar to w but it still doesn't work. Any ideas??
Thanks!!
Jason
have the following lines of code:
CheckNumber btfss PIR1,RCIF ;Check to see a transmission has been made!!
goto CheckNumber
movf RCREG,w
call EE_Read ;Sets w in 0x00 of EEPROM
SUBLW RCREG
btfsc STATUS,Z ;If true then run next line
goto oknum1
goto receive
oknum1 bcf STATUS, RP0 ; Bank 0
movlw 'o'
call send
movlw 'k'
call send
movlw '1'
call send
Whats not working is my SUBLW RCREG. call EE_Read is returning a number
that is store on the chip and pushing that into w. I need to compare w to
what is in my RCREG which should be a single byte of data from the serial
port. I can do something like SUBLW '3' to see if w is equal to 3 which
works fine but the other way doesn't. Is there a way to convert REREG to a
literal to compare it to w and see if they are equal? I have tried serveral
things including declaring a variable and trying - movf RCREG,TempVar and
then comparing TempVar to w but it still doesn't work. Any ideas??
Thanks!!
Jason