Coding the Parallax GPS unit

There is a good tutorial on the Arduino Playground for the GPS I am using: Arduino Playground - GPS

My question though is I want to use the device in Smartmode. This mode allows me to send and receive data from certain registers. To do this I left the /RAW pin disconnected(the data sheet says so, http://grandideastudio.com/wp-content/uploads/gps_manual_2.0.pdf).

Right now I am trying to write code that allows me to just check one register the GetValid register (0x01). But the only thing I am getting when I run the code below is "!GPS 85" over and over again.

int const rxPin = 0;
int const txPin = 1;

int const validityAddress = 0x01;  //tell us if our data is valid, returns 1byte
int const satellites = 0x02;  //# of active satellite connections, returns 1byte
int const latitude = 0x05;  //degrees,minutes,fractional minutes, returns 5bytes
int const longitude = 0x06;  //degrees,minutes,fractional minutes, returns 5bytes
int const boardSpeed = 0x08;  //knots, returns 2bytes
int validity;
 
 
 
 
 void setup() {
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   Serial.begin(4800);   
 }
 
 void loop(){
  digitalWrite(txPin, HIGH);
  Serial.write("!GPS");
  Serial.write(validityAddress); 
  digitalWrite(txPin, LOW);
  digitalWrite(rxPin, HIGH);
  validity = Serial.read();
  digitalWrite(rxPin, LOW);
  Serial.print(validity); 
  delay(500);
 }

For an update. I realized that the data is being mirrored because the data is sent and received on the same pin. To fix the issue I read online that adding a diode can split the line into two. So I have the SIO pin connected to a diode. The output of the diode goes to the Tx pin and the input of the diode goes to the Rx pin. It is still not working though.

Any help would be much appreciated! Thanks.

You are using one of the two discontinued models (p/n 28146, 28506)
The "kickstarter", albeit for another unit of theirs, uses softwareserial.h and flips a datapin (its pinMode) on the fly.
http://learn.parallax.com/kickstart/28500

I would think two diodes...

  • you have one diode with its Anode connected to the GPS and its Cathode (band) to Arduino "data in" (rx)
  • you have one diode with it Cathode (band) connected to the GPS and its Anode going to Arduino "data out" (tx)

?