Recent changes
Slingshot user guide
tag Guide, user
NFCLamp user guide
tag Guide, user
Homepage
MPL115A2
Compiler Error 42
From the mbed microcontroller Cookbook.  

GlobalSat EM 406 GPS Module

This is the GlobalSat EM-406 GPS module with serial interface.

/media/uploads/simon/gpsproduct.jpg

Hello World!

main.cpp

#include "mbed.h"
#include "GPS.h"

Serial pc(USBTX, USBRX);
GPS gps(p9, p10);

int main() {
    while(1) {
        if(gps.sample()) {
            pc.printf("I'm at %f, %f\n", gps.longitude, gps.latitude);
        } else {
            pc.printf("Oh Dear! No lock :(\n");
        }
    }
}

Library

Reference




calendar Page history
Last modified 29 Jul 2011, by   user Eui-Seok Hong   tag EM406, GPS | 10 comments  

10 comments on GlobalSat EM 406 GPS Module:

20 Sep 2010

Might be handy to have functions to return time, date, heading, speed, and altitude.

06 Oct 2010

If you have a commercial serial GPS module available it can also be used on mbed with an RS-232 breakout board and perhaps a PS/2 breakout board. Some low cost serial GPS units such as the GlobalSat BR355 modules get 5V power only off of a PS/2 connector and the data comes out using an RS-232 serial connector. In the BR355 units, a special Y cable with both a PS/2 and a RS-232 serial connector is used. Depending on where it is purchased, this cable may need to be purchased separately from the GPS. These GPS units can cost a bit less (might cover most of the cost of breakout boards) and everything just plugs into a breadboard.

BR355

12 Oct 2010

Why does this get incorrect longitude results? can anyone help please

16 Oct 2010

Hi,

There are two main co-ordinate representations I think; Degrees Minutes Seconds, and Decimal Degrees, and you can convert between them.

I converted it to the right co-ordinate system for google maps, which i think was decimal degrees. Maybe you are using the other system i.e. the raw data (or the calculation is incorrect)?

If you look at the GPS library source, there is a calculation to turn the co-ordinates from one type to another. Perhaps you could take them raw for your application, or perhaps update the library to support both.

05 Nov 2010

Angelo,

I was having similar problems with the longitude, getting positions out off the Pacific coast from here in the Midwest. I solved it by editing line 51 of GPS.cpp. You should see:

Code

degrees = trunc(longitude / 100.0f * 0.01f);

and you should try changing it to:

Code

degrees = trunc(longitude / 100.0f);

I'll probably do some more testing to see what exactly necessitates this change, but I'm guessing it has something to do with the length of the 'longitude' field that we're pulling out of the GPGGA sentence.

31 Jan 2011

incorrect longitude

measured data from EM-406 :224.961273

true data :135degree 37.657minute

why incorrect

latitude is true

25 Feb 2011

Hi all,

I see on your schema that only the TX is connected to the mbed (not the RX). That's true that it's only needed to received raw from the GPS... but why having a RX pin on the GPS then ? To send configuration ?

Regards,

[edit] I see in the spec document : TX: This is the main transmits channel for outputting navigation and measurement data to user’s navigation software or user written software.

  • RX: This is the main receive channel for receiving software commands to the engine board from SiRFdemo software or from user written software.
18 Feb 2012

Code

$GPGSV,1,1,00*79
$GPRMC,195258.455,V,,,,,,,180212,,,N*43
$GPGGA,195259.455,,,,,0,00,,,M,0.0,M,,0000*51
$GPGSA,A,1,,,,,,,,,,,*1E
$GPRMC,195259.455,V,,,,,,,180212,,,N*42
$GPGGA,195300.455,,,,,0,00,,,M,0.0,M,,0000*5C
$GPGSA,A,1,,,,,,,,,,,*1E
$GPRMC,195300.455,V,,,,,,,180212,,,N*4F

This is what the data looks like that I'm getting. As you can see with the GSA messages it is saying that lock is not available. I'm using this device outside with a clear sky and it is wired up exactly as shown in demonstration. Any ideas?

This is what it shows when I power cycle the gps.

Code

$PSRFTXT,Version2:F-GPS-03-1006231*2A
$PSRFTXT,WAAS Enable*66
$PSRFTXT,TOW:  594027*18
$PSRFTXT,WK:   1675*60
$PSRFTXT,POS:  6378137 0 0*2A
$PSRFTXT,CLK:  96250*25
$PSRFTXT,CHNL: 12*73
$PSRFTXT,Baud rate: 4800*65
29 Feb 2012

I think my issue may be a power issue... I've eventually got it to lock but it seems random. One problem I am having is powering the device. I've tried using a 1cell LiPo they sell at spark fun and it is sketchy. Sometimes it works, sometimes it doesn't.

What is a good battery solution for the mbed?

2 weeks, 2 days ago

Hi,

I am having the same problem as Tyler Weaver..

How to get a fix ? is this due to battery? i am running the gps receiver from the 3.3v output from mbed.

the receiver i am using is mediatek 3329

any help will be appreciated.

thanks

Please login to post comments.