Go Down

Topic: Troubleshooting Two GPS Units on one Mega board (Read 457 times) previous topic - next topic

Hi all,

I am working on a university project and am having trouble getting my Arduino Mega to work with two VPN1513 GPS units. The units are plugged in to Serial ports 1 and 2. I have checked and they each work independently, outputting appropriate latitude and longitude. However, when I made a program attempting to use both GPS units on the same board, one of the units does not read properly. What I mean is that one unit will output proper GPS coordinates but the other spits out zeros most of the time or occasionally a number in the thousands. If I change the order that the GPS's are encoded and read, then the other GPS will work but the first one will not. I would like to be able to use both GPS units to provide a heading for the vehicle.

The code is attached below
Thanks for your help!

omersiar

#1
Aug 06, 2014, 02:15 am Last Edit: Aug 06, 2014, 02:22 am by omersiar Reason: 1
What is your GPS Module ? Are they use SPI Sorry, looked your code. How do you connect them?

One is connected into the Serial 1 port and the other into the Serial 2 port. The RX from each GPS is connected into the TX from each board and vice versa. For power I used the 5V output.

Thanks for the help.

CrossRoads

Could the problem be here:

while (Serial1.available()) {
    unsigned char cc1 = Serial3.read(); //read from gps
    unsigned char cc2 = Serial1.read(); //read from gps2

You check to see that data is available on Serial 1, and then read Serial 1 and Serial 3 - but there is no check that data is available on Serial 3.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy