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