Serial comms with Parallax GPS in smart mode?

Hi,

I am trying to speak to a Parallax GPS receiver using Smart Mode (i.e. serial queries) rather than using the RAW NMEA data.

The datasheet/manual is at: http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/GPSManualV1.1.pdf

However, as I am using the Hardware Serial port, I am using the NewSoftSerial library NewSoftSerial | Arduiniana to speak to the GPS unit and I can't be sure if I am speaking to to it correctly as I can't seem to get any data out if it?

The test code is below:

#include <NewSoftSerial.h>

#define  GetValid   0x01
#define MAX_MILLIS_TO_WAIT 2000

unsigned long starttime;
byte valid;       // 0 = not valid, 1 = valid

//  instantiate an object of the SoftwareSerial class so we can talk to the GPS
NewSoftSerial gpsSerial = NewSoftSerial(2, 2);

void setup() {
  pinMode(2, OUTPUT);     // set serial in for gps as output
  gpsSerial.begin(4800);    // begin GPS Serial connection
  Serial.begin(9600);       // begin hardware serial connection
}

void loop () {
  Serial.print("Valid Signal: ");
  pinMode(2, OUTPUT);
  gpsSerial.print("!GPS");
  gpsSerial.print(GetValid);
  pinMode(2, INPUT);

  starttime = millis();
  int noOfBytes = 1;

  while ((Serial.available() < noOfBytes) && ((millis() - starttime) < MAX_MILLIS_TO_WAIT) )
  {
    // hang in this loop until we either get 1 bytes of data or 1 second has gone by
  }
  if(Serial.available() < noOfBytes) {
    Serial.println("ERROR - Didn't get expected data");
  }
  else {
    valid = gpsSerial.read();
    gpsSerial.println(valid);
    
    delay(1000);
  }
}

As you can see all I'm trying to do in this case is to retrieve one byte of data (whether the signal is valid or not) but I don't receive a thing.

I have to send the "!GPS" followed by a command byte (the manual says in hexadecimal, yet surely it gets sent as binary anyway) with the manual defining 0x01 as the command byte to retrieve the 1 byte of data required.

However the Parallax GPS module uses the same pin for TX and RX communicatons, so I have to change the pinMode before receiving data, and I'm not sure if that is the problem? Surely the serial buffer would hold the byte if in came in that time?

Any help or assistance would be greatly appreciated.

Morrolan