0

Recently I bought a GPS module (ublox neo-6M-0-001) for my Arduino Mega 2560. I connected Vcc and Gnd (LED at GPS module glows blue and sometimes blinking).

GPS module RX port is connected to the Arduino's TX3, Port 14. GPS module TX port is connected to the Arduino's RX3, Port 15.

As a first step I just want to print the serial data received from the GPS module:

#include "SoftwareSerial.h"
SoftwareSerial mySerial(15, 14); // RX, TX
void setup() {
 Serial.begin(9600);
 Serial.println("uBlox Neo 6M Test");
 mySerial.begin(9600);
}
void loop() {
 if (mySerial.available())
 Serial.write(mySerial.read());
}

Saldy, there is no data received from the GPS module. According to the datasheet the baud rate 9600 seems to be correct.

Do I need to configure the GPS module somehow before it delivers data? Do I need to buy an external antenna?

Thanks for your help.

dda
1,5951 gold badge12 silver badges17 bronze badges
asked Feb 7, 2016 at 7:38

2 Answers 2

3

The Arduino Mega 2560 has three additional hardware serial ports. Why not use one of them instead? Serial1 on pins 19 (RX) and 18 (TX).

void setup()
{
 Serial.begin(9600);
 Serial.println("uBlox Neo 6M Test");
 Serial1.begin(9600);
}
void loop() // run over and over
{
 if (Serial1.available())
 Serial.write(Serial1.read());
}

Cheers!

answered Feb 7, 2016 at 12:19
3
  • Wow. Very good. If I use the keyword Serial1 instead of the library SoftwareSerial it works perfect. But I don't understand whats wrong with the library. Commented Feb 7, 2016 at 18:55
  • Actually I think it is simply an invalid pin for SoftwareSerial RX. The source code says "Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69". Commented Feb 7, 2016 at 19:02
  • You could use Serial3 on pins 15 (RX) and 14 (TX). Commented Feb 7, 2016 at 19:04
-1

I am also using the sam setup i.e Arduino Mega and NEO6VM2. The GPS module works perfectly fine with a Arduino Uno but when using Mega there are no CharsRX received i.e the Mega is not receiving anything. Please I need help urgently.

answered May 14, 2017 at 6:03
1
  • If you want help, then first of all you should ask a proper question and not post it as an answer to another question. Please learn how to use this site: arduino.stackexchange.com/tour Commented May 14, 2017 at 10:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.