Detecting baud rate for a serial device. (specifically a SR-92 GPS)

Hi,

Is there a way of determining the baud rate of a serial device before successfully talking to it?

I'm trying to talk to a SR-92 GPS unit (http://www.cutedigi.com/pub/GPS/SR-92_User%20Manual_EN.pdf) on a Mega 2560. So far unsuccessfully. The inital problem is that I can't even begin to diagnose anything until I know what baud rate to use! Catch 22.

Basically I've dug the SR-92 out of one of my boxes of bits and am trying to resurrect it, to the best of my knowledge it did work when it went into the box, and the baud rate was probably still set to the default rate (4800). I've wired pin 1 - ground, pin 2- 3.3v, pin 3 (tx) to pin 19 (serial port 1, recieve) and pin 4 (rx) to pin 18 (serial port 1, transmit). Pin 5 is wired to ground as per the datasheet.

The sketch I'm using is very basic...

void setup() 
{
  Serial.begin(115200);            // Baud rate for screen
  
  Serial.println("##################################################################");
  Serial.println("####################     START     ###############################");
  Serial.println("##################################################################");
  
  Serial1.begin(4800);           // Baud rate for GPS unit (default baud for SR-92 is 4800)
  //Serial1.begin(9600);           // Baud rate for GPS unit (default baud for SR-92 is 4800)
  //Serial1.begin(19200);           // Baud rate for GPS unit (default baud for SR-92 is 4800)
  //Serial1.begin(38400);           // Baud rate for GPS unit (default baud for SR-92 is 4800)
  //Serial1.begin(57600);           // Baud rate for GPS unit (default baud for SR-92 is 4800)
}

void loop() {
  
  //Check that there's data waiting to be read
  while (Serial1.available())
  {
    //process current byte from the logger
    Serial.print(Serial1.read());    
  }
}

When I run it, I get the start banner followed by nothing.

Any suggestions? I've been fiddling with it for ages and have tried all the baud rates mentioned in the manual, but with no luck. The GPS is connected directly to the Mega (no buffer) but I believe this is how it's supposed to be connected. I've 'buzzed' the circuit (i.e. done a continuity check) so I'm pretty sure all the connections are good, but I'm running out of ideas.

As a secondary question, does anyone know how to change the baud rate on this device? There's no mention in the datasheet, and if I do get it working I'd prefer to up it to something a bit higher.

Thanks

The default baud rate is 4800 according to the datasheet you linked to. See page 2 and again on page 3.

Mark

You mustn't connect directly to RX on that module, its 3.3V supply. You could get away with just connecting its TX pin to the pin 19. Lets hope you haven't damaged the module.

The default baud rate is 4800 according to the datasheet you linked to

I know. The question wasn't 'what's the default baud rate' it was 'what's the actual baud rate'.

I've actually got a 2nd module, I wired that in and got it working. Must have been a duff module.

You mustn't connect directly to RX on that module, its 3.3V supply

Ooops! Only read this after plugging in the 2nd one! Since I'm only reading from the module, not writing to it I guess I should be ok?

I posted a question on this forum (http://arduino.cc/forum/index.php/topic,128832.0.html) asking if a buffer was required or not, and the consensus was not.

I also found a mention somewhere that the actual default baud rate is 9600, which seems to be correct, despite what the datasheet says.

The final part of my question still remains, how can I change the baud rate? The manual lists 5 baud rates but offers no clue as to how to set them.

Thanks