imhereithink
New Member
Hi guys,
Got a small problem when trying to test what data has been received by the PIC. What i am doing is sending out data, when the receiving end processes the data, it sends "ok" back allowing the PIC to know when it is clear to send more data. I am having trouble reading in and testing the "ok"
The way i am testing the incomming message is by moving the contents of RCREG into a file called store. From here i subract d'79' which is "o" in ascii and test the zero flag bit i.e. if it is "o" then the zero flag will be set. Then i go on to test the "k" part of the message.
This is where the program gets held up, it sends out the required data perfectly, but then stops when testing for "ok" Heres a snippet of code where i test the zeroflag bit:
UART MOVF RCREG, W ;
MOVWF STORE ;
GOTO MODE ;
MODE
BCF STATUS, Z
MOVF STORE, W ;
SUBLW D'79' ;
BTFSC STATUS, Z ;
GOTO SENSOR2 ;
Any pointers would be greatly appreciated
thanks
Got a small problem when trying to test what data has been received by the PIC. What i am doing is sending out data, when the receiving end processes the data, it sends "ok" back allowing the PIC to know when it is clear to send more data. I am having trouble reading in and testing the "ok"
The way i am testing the incomming message is by moving the contents of RCREG into a file called store. From here i subract d'79' which is "o" in ascii and test the zero flag bit i.e. if it is "o" then the zero flag will be set. Then i go on to test the "k" part of the message.
This is where the program gets held up, it sends out the required data perfectly, but then stops when testing for "ok" Heres a snippet of code where i test the zeroflag bit:
UART MOVF RCREG, W ;
MOVWF STORE ;
GOTO MODE ;
MODE
BCF STATUS, Z
MOVF STORE, W ;
SUBLW D'79' ;
BTFSC STATUS, Z ;
GOTO SENSOR2 ;
Any pointers would be greatly appreciated