Connect with us

take from RX, send to TX

Discussion in 'Electronic Design' started by gpsstajer, Jun 27, 2006.

Scroll to continue with content
  1. gpsstajer

    gpsstajer Guest

    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
     
  2. gpsstajer

    gpsstajer Guest

    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.
     
  3. gpsstajer

    gpsstajer Guest

    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
     

  4. 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
     
  5. In the following code I am sending a 'G' from RX, and I am getting G
    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.
     
  6. gpsstajer

    gpsstajer Guest

    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.
     
  7. 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....)
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-