Shop OBEX P1 Docs P2 Docs Learn Events
Navlock GPS — Parallax Forums

Navlock GPS

stoani96stoani96 Posts: 9
edited 2013-03-03 10:16 in Accessories
Hi!
First of all, i'm new here, so i dont know if the place for this thread is right. If not, you can change the location ;)
The next thing: I'm not a english speaking(maybe you already noticed ;) ), but ill try my best

i'm pretty new at Propeller or Spincodes and i wanted to read data out of a gps module. For that i bought a gps module from Navlock(here's the datasheet)
But the problem is: Nothing i try, wants to work!
Here is one of my trys:
2013021502.spin
like you can see, i've 5 leds. the code above should look for a "$"(start of new dataline) and "print" the character after it. how this "printing" should work: i.e. 234: then the third led will blink 2 times, the second 3 times and the first one 4 times
But it is nothing happening! so no "$" is found.... why?!?
(i also tried it with a boudrate of 4800, because i read, that most of the gps modules use this and the object i use is only tested with 19800baud, and i really got something, but only, sry, bullsh**[sometimes values over 200! wide over ascii])

i also tried this:
2013021503.spin
this should save all the "1"s and "0"s and "print" them after recodering 50... but i just get 0..... O.o
How is that possible?!? in the first programm i get anything, not only 125, 126, 255, 256 or 0, and then in the second program i get only 0s....... WHY?

I'm really desperate.... Can anyone help me?
Any tips?
What are the problems of the programs?
How can i fix that?
Or has anyone a object that could help me?(i allready tried the object from this)


thx
stoani96
2013021503.spin
2013021503.spin

Comments

  • FranklinFranklin Posts: 4,747
    edited 2013-02-18 19:38
    Have you tried just printing out what the module sends? That is where I would start.
  • stoani96stoani96 Posts: 9
    edited 2013-02-19 05:39
    Thank you for your answer!
    Of course i tried that:2013021701.spin
    but that gives me some pointless formations of 0s and 1s
    for example:
    11011100111101101011100111101101011100111101101011110111001101011010111001111011100111001111011010111001111011010111101110011010111101110011110111001110011110110101110011010110101101011100111101101011
    
    That makes no sense in my eyes....

    Can anybody tell me if i'm just false(that that makes no sense) or
    tell me whats wrong with my spincode?

    thx
    stoani96
  • stoani96stoani96 Posts: 9
    edited 2013-02-24 05:45
    Can nobody help me?
    ;(
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-02-24 08:16
    Your program is working perfectly, just probably not what you want.
    bytes[index] := ina[30] reads one bit and stores it into a byte variable. It can only have the value of 1 or 0. Which is what you get when you write out the array.

    In your first spin program 2013021502 you are using Simple Serial with a baud rate of 38,400. The comment at the beginning of Simple Serial says it is only good up to 19,200.

    Try FullDuplexSerial

    John Abshier
  • stoani96stoani96 Posts: 9
    edited 2013-02-26 05:51
    Thank you for your answer!
    I'm not sure what you mean with your first paragraph... i WANT to get the 1s and 0s so i can figure out what this thing sends because if i try to get a full byte and let it interpret it by the chip i get something like "$" but only randomly....

    i know that the comment says that it is good up to 19.2kbaud, but it was worth a try ;-)

    thx for the tipp i will try fullduplexserial a bit later.... but i will post my results here ;)

    mfg
    stoani
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-02-26 08:15
    I want ASCII characters (bytes) because I can read them. You are getting random random bytes because you have gone beyond Simple Serial's capability.

    John Abshier
  • David BDavid B Posts: 592
    edited 2013-02-26 20:54
    I would suggest first get the simplest possible program working. That way, you will know you have correct configuration of things like pin wiring, port numbers, baud rate, receive mode (inverted or not signal polarity). Once the program is working, then work on more complicated stuff like writing your own bit receive routines, if that's what you want to do, and GPS message parsers.

    Maybe this program will help get you started. Here is a small but complete working GPS receive program that reads from a Parallax PMB-688 SIRF GPS module and displays messages to the serial terminal.

    Change the port and baud to your GPS settings, start the program, start the Parallax serial terminal and set it to receive at 115200 from your propeller PC port. See if this works.
    CON
    
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
      SIRF_RX     = 20
      SIRF_TX     = 21
      SIRF_BAUD   = 4800       
      SIRF_MODE   = 0         
    
      PC_RX       = 31  
      PC_TX       = 30   
      PC_BAUD     = 115200  
      PC_MODE     = 0
      
    OBJ 
       
      pc_serial  : "FullDuplexSerial"
      gps_serial : "FullDuplexSerial"
        
    PUB start  
    
      gps_serial.start(SIRF_RX, SIRF_TX, SIRF_MODE, SIRF_BAUD) 
      pc_serial.start(PC_RX, PC_TX, PC_MODE, PC_BAUD)
     
      repeat
        pc_serial.tx(gps_serial.rx)
    
    {
    
    sample output, copied from parallax serial terminal screen:
    
    $GPGGA,033553.194,3755.7991,N,12202.7789,W,1,04,4.4,38.6,M,-24.6,M,,0000*55
    
    $GPGSA,A,3,28,07,26,05,,,,,,,,,8.5,4.4,7.2*36
    
    $GPRMC,033553.194,A,3755.7991,N,12202.7789,W,0.31,141.88,270213,,,A*70
    
    $GPGGA,033554.194,3755.7991,N,12202.7789,W,1,04,4.4,38.4,M,-24.6,M,,0000*50
    
    $GPGSA,A,3,28,07,26,05,,,,,,,,,8.5,4.4,7.2*36
    
    }
    
    
  • stoani96stoani96 Posts: 9
    edited 2013-02-27 11:59
    thank you for your answers ;)
    okay.... its a bit embarrassing, but i didn't know that it is THAT easy to get some information to the pc: Parallax Serial Terminal!!! :D

    But i still got a problem.... it still does not work!
    i wrote something like this:
    _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
      SIRF_RX     = 30
      SIRF_TX     = 31
      SIRF_BAUD   = 38400       
      SIRF_MODE   = 1         
    
      
    OBJ 
    
      gps_serial : "FullDuplexSerial"
      terminal : "Parallax Serial Terminal"
        
    PUB start  
    
      gps_serial.start(SIRF_RX, SIRF_TX, SIRF_MODE, SIRF_BAUD) 
    
      terminal.start(115200)
      repeat
        terminal.char(gps_serial.rx)
    

    but this gives nonesense...
    [code]p
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-02-27 12:08
    Your gps_serial object is using pins 30 and 31. These are the same pins used by the terminal object. The GPS needs to use different pins than the one connected to the PC.

    John Abshier
  • stoani96stoani96 Posts: 9
    edited 2013-02-27 12:22
    i only changed David Bs code
    like you can see i use the USB connection for the serial terminal:

    terminal.start(115200)

    so i dont think that this is a problem, is it?
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-02-27 12:38
    The usb on most boards uses pins 30 and 31. Parallax Serial Terminal start uses pins 30 and 31. Look at the code. David B used 20 and 21 for the GPS. You really need to learn about the Propeller and its tools. In the Propeller Tool click on Help and then Propeller Education Kit or go to this site http://learn.parallax.com/propeller-board-education

    John Abshier
  • stoani96stoani96 Posts: 9
    edited 2013-02-27 12:47
    Damn! Your right!
    I trusted the code(parallax seriel terminal) way too much!
    I really thank you for that!
    One last(for now ^^) question: can i change the pins that are used by the seriel terminal code?(i tried it seems that does not work.. is that right?)

    mfg
    stoani
  • David BDavid B Posts: 592
    edited 2013-02-27 13:48
    I am seeing a common mistake in several of your posts - you are wrongly using ports 30 and 31 when you configure your GPS serial object.

    You connected your GPS module serial output wire to one of the propeller pins, right?

    Your serial receive object needs to listen to THAT port, the port that connects to the pin the GPS is wired to, NOT ports 30 or 31.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-02-27 15:01
    stoani, you need to look at the code. That is the only way you will make progress. From Parallax Serial Terminal
    PUB StartRxTx(rxpin, txpin, mode, baudrate) with this method you can use any transmit and receive pins you want. BUT the USB connector on your Propeller board is probably wired to pins 30 and 31.

    John Abshier
  • stoani96stoani96 Posts: 9
    edited 2013-02-28 09:39
    I already figured it out, thank you!
    The USB connection runs over pins 30 and 31. and i didnt know that when i solderd on the gps. so it is right that i used pins 30 and 31, but it was pointless because of the fact that the usb connector is there ;)
    I will fix the soldering asap and then it should finally work! ^^
    I will keep you up to date ;)
    finally something to john abshier: i always look to the codes(ofcourse sometimes too inaccurate :D) and i know that you can choose any pin for the serial terminal and like you can see abouve, i also know that the usb connection is on 30 and 31. so the problem is solved for now ;)

    stoani
  • stoani96stoani96 Posts: 9
    edited 2013-03-02 04:10
    It works!
    Thanks to every one here! ;) I learnt a much!
  • David BDavid B Posts: 592
    edited 2013-03-03 10:16
    Good job! have fun with it.
Sign In or Register to comment.