YESSSS!!!!!! FINALLY!
Ive compiled and uploaded a program that autodetects the boudrate, and used that boudrate to communicate with the module. Apperantly I've missed the 38400! Shame on me, you where right AWOL!
The used code to detect the GPS boudrate:
/*
First stab at a auto baud rate detection function. This uses the pulseIn command
to determine what speed an unknown serial link is running at. Detects and sets the standard baud
rates supported by the Arduino IDE serial monitor. Uses character "U" as a test character
I'm sure characters with multiple zero bits in a row may fake out proper detection. If data is
garbled in the serial monitor then the auto baud rate function failed.
This is just a demo sketch to show concept. After uploading the sketch, open the serial monitor
and pick a random baud rate and then start sending U characters. The monitor will print out
what baud rate it detected. It will default to 9600 baud if found a bit
width too long for a standard rate used by the serial monitor. Not that as written, this is a
'blocking' function that will wait forever if no character are being sent.
Note that while the serial monitor has a 300 baud option, the Arduino hardware serial library
does not seem to support that baud rate, at least for version 22, in my testing.
By "retrolefty" 1/22/11
*/
int recPin = 2; //the pin receiving the serial input data
long baudRate; // global in case useful elsewhere in a sketch
void setup()
{
pinMode(recPin, INPUT); // make sure serial in is a input pin
digitalWrite (recPin, HIGH); // pull up enabled just for noise protection
// Function finds a standard baudrate of either
// 1200,2400,4800,9600,14400,19200,28800,38400,57600,115200
// by having sending circuit send "U" characters.
// Returns 0 if none or under 1200 baud
Serial.begin(9600);
}
void loop()
{
baudRate = detRate(recPin);
Serial.println();
Serial.print("Detected baudrate at ");
Serial.println(baudRate);
}
long detRate(int recpin) // function to return valid received baud rate
// Note that the serial monitor has no 600 baud option and 300 baud
// doesn't seem to work with version 22 hardware serial library
{
long baud, rate = 10000, x;
for (int i = 0; i < 10; i++) {
x = pulseIn(recpin,LOW); // measure the next zero bit width
rate = x < rate ? x : rate;
}
if (rate < 12)
baud = 115200;
else if (rate < 20)
baud = 57600;
else if (rate < 29)
baud = 38400;
else if (rate < 40)
baud = 28800;
else if (rate < 60)
baud = 19200;
else if (rate < 80)
baud = 14400;
else if (rate < 150)
baud = 9600;
else if (rate < 300)
baud = 4800;
else if (rate < 600)
baud = 2400;
else if (rate < 1200)
baud = 1200;
else
baud = 0;
return baud;
}