Good day
I am trying to interface a ublox lea-6h GPS module with the mega 2560 through a UART connection. The GPS module is already mounted on a breakout board with a PCB antenna and the appropriate voltage level converters. Here is a link of the product that I purchased: http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Receiver-Boards.asp
I purchased this receiver board to make the interfacing easy. On this board there are only 6 pins. 5v, GND, RS232 Data out, RS232 Data in, TTL Data in and TTL data out. The board also has a mini USB connection used for configuration of the module. There is a layout of the PCB at the link above.
I decided to write a basic code to receive information form the GPS and check the response in the Arduino serial monitor, When I do this I only receive gibberish and random characters that make no sense at all. At first I thought it might be a mismatch in the baud rates, but I have made sure that the GPS and Serial baud rates match, the standard baud rate the GPS uses is 9600, which works for me. I have tried pretty much everything and can't figure out where the problem might be. I have also tried a basic program to write messages to UART port 1 and read it from UART port 0 through a serial moitor to make sure things work there, and that seems to work just fine.
Here is the code that I have used to test the module through UART:
void setup()
{
Serial.begin(9600);
Serial.print("Begin GPS Test"); // Text to make sure serial monitor reads at correct baud rate.
}
void loop()
{
if(Serial.available()>0)
{
delay(30);
while(Serial.available()>0){
byte data = Serial.read();
//Serial.print(incoming,DEC);
//Serial.print(incoming,HEX);
Serial.print(char(data));
Serial.print(",");
}
Serial.println(" ");
}
}
I am not sure what exactly the GPS module sends the characters as, but I am pretty sure it is as characters.
U-blox also allows for the lea-6h to be configured through USB by the software u-center. In this software I have configured the baud rate to 9600 for the GPS module and to send only one message for testing which is the NMEA message GxRMC (Recommended Minimum Specific GNSS Data) . The software allows you to monitor the sent data in either a packet console, a binary console or a text console. And when I check this the right messages are being sent to the UART, so I think the problem might be on the Arduino side.
Here are a few links to screenshots to what I have explained above, just to give a clear understanding of what I did.
Message Configuration: http://img696.imageshack.us/img696/9324/messageconfiguration.png
Text console sent messages: http://img594.imageshack.us/img594/7472/textconsolermcmsg.png
Serial Monitor: http://img221.imageshack.us/img221/7756/serialmonitor.png
I have also tried connecting this module to the UNO with the exact same result. If anyone can help me with this I would really appreciate it.