take from RX, send to TX

In the following code I am sending a 'G' from RX, and I am getting G instead of ' 0 '. Then I am sending another character and I never gets the char ' 0 '. My PIC doesn't compare the value that it gets from RX. It always sends the char that it gets. again call RXget movwf temp xorlw 'G' bz send0 movf temp,W call TXsend goto again send0 movlw '0' call TXsend From PC INPUTS: GPRMC OUTPUTS OF PIC: GPRMC

Reply to
gpsstajer
Loading thread data ...

I am using a GPS reciever to take the positon, And this gps reciever sends the positon data in a sentence which starts with $GPRMC,1,,12,3,23,3. If I cannot know if 'G' has come or not, then I cant take the posisiton data. So I must compare 'G' with incoming messages. I am sure that it sends all the chars without any compare.

Reply to
gpsstajer

If I initialize the usart wrongly, I think it also shouldnt send the other chars. And Do you know the software Proteus. It can simulate the circuit. I connect gps reciever to com 1 and simulate the circuit. It works correctly. But with my pic17f877, it doesnt fo the compare

Reply to
gpsstajer

Are you sure it's actually working and your terminal is not just supplying the echo?

What happens if you precede the first TXsend with movlw '1' or whatever...

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

You're using a 16F pic, this series does not have the BZ instruction. I have no idea why your compiler doesn't pick this out for you, but if it just ignores this instruction, All your code does it echo the character.

Reply to
Jasper Keuning

I heard from someone that mplap compiler automatically creates a btfss and goto command. And I tried if it does or doesnot working. It works.

Reply to
gpsstajer

The GPS receiver probably sends several different sentences, all starting with "$GP", so you should first look for a "$", as that will only occur at the start of the sentence. You can then ignore the "GP" talker ID, and look for the "RMC". If you don't find "RMC", discard characters til you see the next "$". (Of course, you have to get the receive routine working correctly before you have to worry about these details....)

--
Peter Bennett VE7CEI 
email: peterbb4 (at) interchange.ubc.ca        
 Click to see the full signature
Reply to
Peter Bennett

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.