Pages: [1]   Go Down
Author Topic: Arduino Due serial problem with GPS  (Read 748 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi folks,

I have recently bought an Arduino Due. I would like to output raw GPS data (NMEA sentences) on the Serial monitor, but it outputs garbage in the Serial Monitor (45,23,85,34,...). The code used looks like that:

Code:
void setup()
{
  Serial3.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  while(Serial3.available())
  {
    Serial.println(Serial3.read());
  }
}

This code worked on my Arduino Mega, but doesn't work on the Due.
The creepy thing is that processed data with TinyGPS works on the Due and shows latitude etc. on the Serial Monitor, but raw GPS data seems being untouchable on the Due.


Any idea?
Logged

Offline Offline
Edison Member
*
Karma: 48
Posts: 1614
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try Serial.write instead of println.

Pete
Logged

Where are the Nick Gammons of yesteryear?

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12062
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

read() returns int, you'll have to cast to char to make it a character.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 1
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have Skylab  SKM53 Gps module working perfectly, almost out of the box, with my arduino due.

I've connected the GPS Rx pin to Tx1 on the Due and the GPS Tx pin to the Rx1 on the due.... Serial1.begin(9600).... and it's done...

Be aware that if you are indoor, the gps may take as long as it takes to show data (maybe more than two hours)... so try it outdoors and you'll begin receiving data in a few minutes after the gps knows where it is..

Try TinyGps++ or TinyGps13 library !!

http://arduiniana.org/2013/09/greater-accuracy-with-tinygps-13/

Good luck and merry Christmas!!!
Logged

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

Thank you very much!

It works with Serial.write(), and I also tried TinyGPSPlus. It's just amazing! smiley-twist
Logged

Pages: [1]   Go Up
Jump to: