Shop OBEX P1 Docs P2 Docs Learn Events
PMB-688 and the Arduino...again. — Parallax Forums

PMB-688 and the Arduino...again.

VamPVamP Posts: 17
edited 2012-10-24 16:05 in General Discussion
I have done a few things...

I have used a usb-to-serial (FTDI breakout by sparkfun.com) to test the GPS module. It spits out data just fine.

I have sent the Arduino data via the usb-to-serial breakout board. I have also sent the usb-to-serial data through the Arduino. Works fine.

I have tried outputting data to an small LCD screen. I get nothing.

I have tried the UNO and the Duemilanove both have acted identical.
Using this pin-out setup http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/PMB-688_Specification_V0.1.pdf
(TX, RX, Vcc, Vss, N.C., N.C.)

I have tried this code (with no data received):
#include <SoftwareSerial.h>

SoftwareSerial sSerial(2, 3);

void setup(){
pinMode(13, OUTPUT);
Serial.begin(4800);
sSerial.begin(4800);
}

void loop(){
if (sSerial.available()){
Serial.write((int)sSerial.read());
}
}

I have tried this code (with no response):
void setup(){
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Serial.begin(4800);
}

void loop(){
if (sSerial.available()){
digitalWrite(13, HIGH);
}
}


EDIT: Before anyone says to check my wiring. I have done so already. I have connected the TX to the usb-to-serial, seen it spit out data. Then ONLY move the TX and have it not spit out anything to the Arduino.
«1

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-15 09:13
    Could your RS232 output be inverted? This is another common problem in building your own interface. Highs that should be lows and lows that should be highs.
  • VamPVamP Posts: 17
    edited 2012-10-15 09:33
    It only supports TTL and I honestly don't know. I'm using the serial library in the Arduino IDE. Is there a way to test this at all?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-15 11:22
    Well, it you reverse the highs and lows in code, it won't hurt the electronics. Just be sure you are staying within the proper range of +5 to 0 or +3.3 to 0.

    If you look at the TTL output +5 should go to an RS232 level shifter that inverts the output and becomes something like -9 to -12 volts. And a TTL output of 0 volts should go to an RS232 level shifter and output +9 to +12 volts. That is historically why there is an inversion involved.

    So at times if you just go TTL to TTL, the inversion is not right. Does the LCD screen have a configuration choice for regular or inverted TTL? That might make it even easier to resolve.

    The fact that everything else seems to get it right, indicates that it is either this OR wiring OR the wrong detailed configuration (baud rate, parity, stop bits, hard and soft handshaking).
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-15 11:28
    The PMB-688 and Arduino are compatible, there is no matter of "inversion".
  • max72max72 Posts: 1,155
    edited 2012-10-15 14:18
    This is probably a question for the Arduino forum, but I'll tell how I would approach it. This is an abstract point of view knowing nothing about arduino.
    You know the gps is sending valid data and the wiring is correct.
    So trouble probably lies in software serial decoding (inverted/non inverted) or on the lcd part.
    Can you test the lcd part is ok by sending data from a terminal? Something like typing data in the terminal and seeing it streaming on the lcd? In an ideal world it would require changing the pin number from the gps port to the pc port.
    On the software serial decoding side you should check if you can set the inverted/noninverted mode and try both.
    Massimo
  • VamPVamP Posts: 17
    edited 2012-10-15 14:36
    Thank you all for responding.
    The LCD screen is just a small screen from adafruit (http://adafruit.com/products/198)
    Yes, I can display data on the LCD. (Hard coded or sent from Serial monitor)

    I'm glad I am not the only one who is a little befuddled from this.

    Does anyone know how to change the 688's baud? Maybe if I bump it up to 9600... (Pulling at strings here)
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-15 17:33
    4800 is the NMEA standard.
    I never work with any of the Arduino libraries.
    It seems like what you're trying to do is capture each and every character and knock that out to your LCD.
    I've used the '688 with Arduino to capture the time of day characters from the RMC sentence.
    I buffer that data and then knock it out to a display.

    The following Kickstart is for the '648, but it may be of some interest anyway.
    http://learn.parallax.com/kickstart/28500
  • VamPVamP Posts: 17
    edited 2012-10-16 06:12
    PJ Allen wrote: »
    4800 is the NMEA standard.
    I never work with any of the Arduino libraries.
    It seems like what you're trying to do is capture each and every character and knock that out to your LCD.
    I've used the '688 with Arduino to capture the time of day characters from the RMC sentence.
    I buffer that data and then knock it out to a display.

    The following Kickstart is for the '648, but it may be of some interest anyway.
    http://learn.parallax.com/kickstart/28500

    Really? 4800 standard? I wonder why so slow. I mean not that it really needs to be faster.

    I have compiled the Arduino uno code in that link you gave me. I have attached the GPS to pin 6 with TX(Yellow wire) as stated in the article. I have opened the serial monitor on the Arduino IDE with a baud rate of 115200.

    I receive the "Reading GPS" but even after leaving it running for 5 minutes. I have no data.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-16 11:20
    So the 688's red LED is blinking, as I recall that indicates that it's locked on.
    I connected the 688 data out to Arduino D0 (RX), I'm not a "softserial maven".
    Later this evening I'll try to find time enough to post what I've done with it.
    http://www.youtube.com/watch?v=OW8FVmrA7js


    This youtube video is informative
    http://www.youtube.com/watch?v=AO_Dv6kqn5k
  • VamPVamP Posts: 17
    edited 2012-10-16 12:27
    PJ Allen wrote: »
    So the 688's red LED is blinking, as I recall that indicates that it's locked on.
    I connected the 688 data out to Arduino D0 (RX), I'm not a "softserial maven".
    Later this evening I'll try to find time enough to post what I've done with it.
    http://www.youtube.com/watch?v=OW8FVmrA7js


    This youtube video is informative
    http://www.youtube.com/watch?v=AO_Dv6kqn5k

    Watched both videos, thank you for your continued help.

    My setup is very simple, in fact exact setup in the second video.

    Yellow(TX) to pin 2.
    Red to Vdd.
    Black to Vss.

    The only difference I noticed in the videos code was he set different serial rates. He had the GPS on 4800 (same as me) But he had the Arduinos hardware UART to 9600. I have been setting them both to 4800. I don't THINK this would make a difference but I will go and try this right now.


    EDIT: Tested '688 with 4800 baud and Arduino UART at 9600. Made no difference at all. Still receiving no data.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-16 17:39
    PJ Allen wrote: »
    So the 688's red LED is blinking, as I recall that indicates that it's locked on.

    Sorry. The red LED's blinking indicates that it's acquiring, it goes solid on when it has valid data.
    It would be beneficial to knock the data out to Serial Monitor as quickly as possible.

    Two questions:
    Is your red LED turning solid on at some time then?
    You're running the '688 from Arduino 5V?

    Have a look at this link --
    http://arduino.cc/forum/index.php/topic,109398.0.html
  • VamPVamP Posts: 17
    edited 2012-10-17 05:13
    PJ Allen wrote: »
    Sorry. The red LED's blinking indicates that it's acquiring, it goes solid on when it has valid data.
    It would be beneficial to knock the data out to Serial Monitor as quickly as possible.

    Two questions:
    Is your red LED turning solid on at some time then?
    You're running the '688 from Arduino 5V?

    Have a look at this link --
    http://arduino.cc/forum/index.php/topic,109398.0.html

    Yes I have tested it with valid data (a lock) and non valid data (no lock).
    Yes I am running it from the Arduino uno's 5v.

    I looked at that, didn't know it had a buffer limit. I mean... It makes sense. But it didn't cross my mind. In my first code (when I expected it to work) I was initializing my own buffer.

    char buffer[300] = "";
    for (int i = 0; i < 300; i++){
    buffer = ' ';
    }

    At the moment of just trying it to relay data I am not using really any buffer. I am basically just using the arduino to repeat any data from the softwareSerial out to the hardware serial.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 16:24
    Here's a test, part of my experiment/s:
    // serialexper05
    // to trigger event
    // resulting from successful
    // capture of $GPRMC header
    //
    // trying to capture seconds
    // i.e. -- bytes 11,12
    // and print them out  works  03/08/2012
    
    byte serial_idx;
    byte GPSchar [13];   // bytes 0 - 12 ! !
    byte GPSchk [7] = {36,71,80,82,77,67,44};
    //                 $  G  P  R  M  C  ,
    
    
    void setup()
    {
      Serial.begin(4800);
      pinMode(13, OUTPUT);
    }
    
    void loop()               // wait for $GPRMC,
    {
      while (serial_idx < 7)
      {  
        if(Serial.available() > 0)
        {
          GPSchar[serial_idx] = Serial.read();
          if(GPSchar[serial_idx] == GPSchk[serial_idx])
          {
            serial_idx++;
          }
          else
          {
            serial_idx = 0;   // 
          }
        }
      }
      while (serial_idx < 13)  // loop - capture hhmmss bytes
                               // GPSchar[07]..[12]
      {
        if(Serial.available() > 0)
        {
          GPSchar[serial_idx] = Serial.read();
          serial_idx++;
        }
      }
      successblink();
    }
     
    void successblink()      //  may leave unused
    {
      digitalWrite(13, HIGH);
      delay(75);
      digitalWrite(13, LOW);
      Serial.print(GPSchar[11],DEC);
      Serial.print("  ");
      Serial.println(GPSchar[12],DEC);
      for (int ax=0; ax<13; ax++) //clear GPSchar array
      {
        GPSchar[ax]=0;
      }
      serial_idx = 0;
    }
    

    Connect GPS data to D0.
    Each time the GPS prints "$GPRMC," D13 will blink and the seconds characters will print on Serial Monitor,
    The '688 has several sentences enabled, so it won't blink 1pps.

    See how that works and then give it a shot with "software serial".
  • VamPVamP Posts: 17
    edited 2012-10-17 16:44
    PJ Allen wrote: »
    Here's a test, part of my experiment/s:
    // serialexper05
    // to trigger event
    // resulting from successful
    // capture of $GPRMC header
    //
    // trying to capture seconds
    // i.e. -- bytes 11,12
    // and print them out  works  03/08/2012
    
    byte serial_idx;
    byte GPSchar [13];   // bytes 0 - 12 ! !
    byte GPSchk [7] = {36,71,80,82,77,67,44};
    //                 $  G  P  R  M  C  ,
    
    
    void setup()
    {
      Serial.begin(4800);
      pinMode(13, OUTPUT);
    }
    
    void loop()               // wait for $GPRMC,
    {
      while (serial_idx < 7)
      {  
        if(Serial.available() > 0)
        {
          GPSchar[serial_idx] = Serial.read();
          if(GPSchar[serial_idx] == GPSchk[serial_idx])
          {
            serial_idx++;
          }
          else
          {
            serial_idx = 0;   // 
          }
        }
      }
      while (serial_idx < 13)  // loop - capture hhmmss bytes
                               // GPSchar[07]..[12]
      {
        if(Serial.available() > 0)
        {
          GPSchar[serial_idx] = Serial.read();
          serial_idx++;
        }
      }
      successblink();
    }
     
    void successblink()      //  may leave unused
    {
      digitalWrite(13, HIGH);
      delay(75);
      digitalWrite(13, LOW);
      Serial.print(GPSchar[11],DEC);
      Serial.print("  ");
      Serial.println(GPSchar[12],DEC);
      for (int ax=0; ax<13; ax++) //clear GPSchar array
      {
        GPSchar[ax]=0;
      }
      serial_idx = 0;
    }
    

    Connect GPS data to D0.
    Each time the GPS prints "$GPRMC," D13 will blink and the seconds characters will print on Serial Monitor,
    The '688 has several sentences enabled, so it won't blink 1pps.

    See how that works and then give it a shot with "software serial".


    Again I thank you, but come baring bad news. No flashing the LED nor any data received by the monitor.


    For shits and giggles I setup a little fun. I hooked up the gps to an xbee, then another xbee to FTDI to PC. Then used a serial monitor. Guess what? I received data.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 17:07
    Yeah?
    Well how about the second XBee to the Arduino instead?
  • VamPVamP Posts: 17
    edited 2012-10-17 17:33
    You are not going to believe this...

    GPS to Xbee to Xbee to Arduino to PC.

    I get data.

    What the HELL does that mean?!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 17:37
    I'm stumped. :zombie:
  • VamPVamP Posts: 17
    edited 2012-10-17 17:43
    The only thing I can think of is... Is how is the Arduino with signal processing? Maybe the signal from the GPS is a little dirty and the xbee cleans it up a bit? No idea.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 17:46
    No way.

    You still running the GPS (in Reply 17) from Arduino 5V?
    That's the only thing, I don't run the GPS from Arduino 5V - it's separate.
  • VamPVamP Posts: 17
    edited 2012-10-17 17:50
    Actually I have two xbees (3v) and the GPS (5v) all running from the Arduino.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 17:58
    If you were over here we'd put it on the 'scope.

    More than that I cannot say. ( :

    [Maybe I'd look at it, point, and say "Oh, oh - lookit!"]

    Even though I'm running my GPS off a separate 5V, it's wired straight to a Nano and everything's everything.
  • VamPVamP Posts: 17
    edited 2012-10-17 18:07
    You wouldn't happen to be in New York would you? Haha... I don't know man. It stumped me at post #1.
  • VamPVamP Posts: 17
    edited 2012-10-18 06:49
    Just wired it up to my DSO Nano v2. Pretty clean signal at 1.8v
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-18 09:05
    VamP wrote: »
    Just wired it up to my DSO Nano v2. Pretty clean signal at 1.8v

    What's that you say?

    -- Power requirements: 3.3V - 5V DC @ 65mA --

    The output levels should approximate the supply.
  • VamPVamP Posts: 17
    edited 2012-10-18 10:46
    PJ Allen wrote: »
    What's that you say?

    -- Power requirements: 3.3V - 5V DC @ 65mA --

    The output levels should approximate the supply.

    =O
    Interesting...

    So it's likely that the Arduino is just seeing a jumpy bunch of zeros?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-18 11:20
    A bunch of not HIGHs (or not HIGH-enoughs). A minimum valid HIGH is, IIRC, around 2.5V

    The XBee, being a 3V deal, figures it's good enough.

    With a couple of transistors, you could make a double inverter.
    The first stage's output would rock 0/5V and the second stage would rightwise it.

    Is it "brand new" or just new to you? (What's its provenance?) ( :
  • VamPVamP Posts: 17
    edited 2012-10-18 11:45
    I bought it from Parallax a while back (about a year) couldn't get it working. Came here, found that the wiring was not what it was labeled on the board. After getting the correct wiring schematic I still could not get it to communicate with the Arduino so I put it away after getting frustrated with it. I know a bit more than I used to so I came back to it to see what I could do. Still couldn't get it to work, so I came here again.

    The interesting part? Parallax tested it for me.

    I'm am by no means an electrical engineer so not sure how to set that up. haha. How would I set up those transistors and which transistors do you recommend? I would love to test this.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-18 12:46
    Circuit attached.
    Any small-signal NPN should do it (2N3904, PN2222..)

    The wires are labelled in the document.
    The wires/connector don't match the labelled pads on the board.
    But the labels for the pads on the board are correct for those pads.
    You're not the first person to assume that the two correspond.
    385 x 318 - 9K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-22 08:48
    VamP wrote: »
    Just wired it up to my DSO Nano v2. Pretty clean signal at 1.8v
    PJ Allen wrote: »
    What's that you say?

    -- Power requirements: 3.3V - 5V DC @ 65mA --

    The output levels should approximate the supply.

    Despite the subject's going cold, I put mine on the scope.
    Never been an issue, so I never looked at it before.
    With a 5V supply it's 0/3V.
    3V is 3/5 of 5V. So, 3/5 of 3V is 1.9V. Maybe I should try a 3V supply?
    The Arduino boards have only one 5V pin, the one right next it is 3V, so.. I'm just wondering.
    The GPS will run from 3V (according to the docs), but the Arduino won't recognise a 1.9V as a valid 'high'.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-22 08:57
    PJ Allen wrote: »
    Maybe I should try a 3V supply?
    Just did. And it's... (wait, wait, wait) 0/3V !
Sign In or Register to comment.