Pages: [1]   Go Down
Author Topic: problems reading gps output  (Read 1733 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!
i'm trying to read gps(global sat et-332) tx output using arduino mega 2560
i've connected gps tx to arduino rx1
gps configured to work in nmea mode, if i connect it to pc - i get perfect nmea output

but when i when i run this code on arduino
Code:
void setup() {
  // initialize both serial ports:
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop() {
  // read from port 1, send to port 0:
  if (Serial1.available()) {
    char inByte = Serial1.read();
    Serial.write(inByte);
  }
  
 
}

i get this
Code:
‰‰é9óæ̦&¦f³¦&æssssóæóææssS9ófóæS9sóæææfM™—ž=›æ̦æ&f³¦&æS¦&æÌÓ:>6NÆN>2"26F:>2NêN:N>2N2F&N6>FNÊN:.F*NÊNN>>>>V*Ê֛ù‰‰é9óæ̦æ¦Ì³¦&æS¦&æÌÓ>NÆN>2"26F:>"NêN:N>2N2F&N6>FNÊN:.F*NÊNN>>>>V*:ÊÖ

instead of NMEA

none of googled gps reading solutions are worked, i'm stuck smiley-sad

« Last Edit: July 14, 2012, 03:10:36 am by 1101 » Logged

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

I haven't used a GPS device before. But I do know that when talking over the Serial monitor you have to use the right baud rate. Perhaps 9600 baud is the wrong rate. Also you misspelled Serial in your code. Perhaps that may be causing the problem.
Hope this helps.
Logged

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

whwn i connect to pc using same baud rate - i get nmea sentences

misspelled? where? i'm using arduino mega, it has 3 serial's, i connect gps to serial1 rx
Logged

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

In void setup you have it as "Seriall.begin(9600);
You put an extra 'l', lol
Logged

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

dude, it's 1(one) smiley
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 506
Posts: 19120
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How have you connected it, hardware-wise?

From the datasheet I found:

Quote
Output TTL level , 0V ~ 2.85V

I'm wondering if, electrically, it is matching up.

Maybe the logic levels are inverted, the datasheet is a bit vague on that point.
Logged


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

i thought about it.
But how do i check it or how do i invert it?
Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 25
ummm?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm- I can't get the sheet to open from USGlobalsat.  But the board I have from them runs at 4800 baud, default- might be worth a quick try just to see...

t
Logged

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

nope
4800 gets almost same result
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 506
Posts: 19120
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post a link to a datasheet that describes the requirements in detail? Like, logic levels, whether a 1 is 0V, 5V, -5V and so on?
Logged


0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like you have an RS232 level device connected to the TTL level Arduino.

Get yourself a MAX232 or equivalent circuit to do the appropriate level shifting.

-j
Logged

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

but i thought that arduino can understand rs-232
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 644
Posts: 50500
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but i thought that arduino can understand rs-232
We can't help what you think. The FACT is that it can't.
Logged

Pages: [1]   Go Up
Jump to: