Pages: [1]   Go Down
Author Topic: Troubleshooting Two GPS Units on one Mega board  (Read 345 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

* dualGPSplus_ino.ino (3.29 KB - downloaded 8 times.)
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is your GPS Module ? Are they use SPI Sorry, looked your code. How do you connect them?
« Last Edit: August 05, 2014, 07:22:24 pm by omersiar » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27361
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: