Using an EM-408 GPS with a BS2
er56
Posts: 5
I am looking for some sample code to interface an em-408 (us sat) gps with my BS2.
Does anyone have experience using that particular gps module?
My goal is to develop a geo-cashing setup similar to the one presented in MAKE magazine but with the em-408, instead of the parallax gps module.
I have tinkered with the code from that particular project but have not been able to get reliable data from the gps.
Any advice on how to alter the code appropriately would be appreciated.
Does anyone have experience using that particular gps module?
My goal is to develop a geo-cashing setup similar to the one presented in MAKE magazine but with the em-408, instead of the parallax gps module.
I have tinkered with the code from that particular project but have not been able to get reliable data from the gps.
Any advice on how to alter the code appropriately would be appreciated.
pdf
385K
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
I went ahead and contacted Global Sat and, unfortunately, they are unwilling to help. I ordered the GPS from Spark Fun and I will go ahead and post over there as well and see if anyone can help. Their forum does not usually deal with Basic Stamps but I will give it a try anyway.
As far as my platform is concerned, I am using a BS2, a 2x16, Backlit, Parrallax LCD.
The baud for the LCD is: LcdBaud CON 84 (9600)
The baud for the GPS, per Global Sat specs, is: GPSBaud CON 188 (4800)
Regarding the data I am getting, this is an example of what I am getting on the LCD which is seemingly random:
100 deg. 46" 79.1' N
060 deg. 15' 79.1' E
Here is the SEROUT/SERIN for the GPS "get latitude":
' get latitude from GPS
SEROUT GPS_SIO, GPSBaud, [noparse][[/noparse]"!GPS", GetLat]
SERIN GPS_SIO, GPSBaud, 3000, No_Response, [noparse][[/noparse]degrees, minutes, minutesD.HIGHBYTE, minutesD.LOWBYTE, dir]
Here is the command to "display latitude":
' display latitude on LCD line 1
SEROUT LCD_TX, LcdBaud, [noparse][[/noparse]LcdLine1, DEC3 degrees, DispCC0, " ", DEC2 minutes, MinSym, " "]
SEROUT LCD_TX, LcdBaud, [noparse][[/noparse]DEC2 (temp / 10), ".", DEC1 (temp // 10), SecSym, " ", "N" + (dir * 5)]
Even more confusing, the numbers continue to change every few seconds, line by line, sometimes a whole line changes simultaneously, sometimes just the individual deg., seconds, and hours.
It may be that the GPS is not getting a satellite lock but from everything I have read about this unit it should not be having a lock problem. Just to be sure, I did move the GPS to different outdoor locations with no overhead obstructions.
I am starting to suspect that my problem is related to the Parallax GPS "smart" mode that partially parses the GPS data. It may be that my GPS isn't able to send me accurate data because the command is truncated?
Any other ideas for me? Hopefully I have given some more useful info this time around.
Thanks Again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I may be wrong about this, but I suspect you're trying to use the "Smart Mode" commands with a GPS that does not have that mode. The code that you posted (and I quoted above) is directly from the Parallax GPS demo, right? That code assumes a "Smart Mode". I just looked through the datasheet for the EM-408, and while there are commands that can be sent to it (to warm start it, to adjust the baud rate, etc.), they don't seem to be much like the commands that the Parallax GPS uses in Smart Mode. Were you assuming that you could use the Parallax Smart Mode demo code with GPS modules in general? I'm fairly certain that you cannot.
I think that instead what you will need to do is to just let the EM-408 transmit the NMEA strings (which it should do as soon as you power it up, though they won't be valid until you get a fix, of course), and you wait for a $GPGGA string, which you then parse to get the data you're after. I've done that with a BS2 and the Parallax GPS in normal (not "Smart") mode, and it works just fine, though you won't have enough variable space to take in all of the data (you just have to share variable space, using it now for Latitude and Longitude, then reuse it for time and date, and so on).
edit: I found this while browsing, and it might help point you in new directions: http://diydrones.com/forum/topics/705844:Topic:39728
Post Edited (SRLM) : 8/21/2009 2:07:12 AM GMT
I was able to get data from a debug code provided by the same source I started with.
The data looks like this:
131∞ 86' 38.6" ˝ (
if you have any question about it i'm ready to help as much as i know
i'm working on it since last year in both smart and raw modes and i got alot of experience on it
regards
I wonder if working in the Mac terminal makes a difference or if that could be the reason I am not getting any info in my debug terminal. Even when I unplug the GPS I am not getting an error message, which is clearly in the subroutine. I will give it another shot.
mechano, I am currently, without much luck, trying to set up a US Sat em-408 GPS. If I end up running the parallax GPS I will gladly pick your brain. Will let you know.
Thanks, as always.
If you don't see that output, then you know that there is a problem with setup (your terminal, USB-to-serial, BOE, etc.), but not necessarily the GPS.
Post Edited (SRLM) : 8/26/2009 8:49:28 PM GMT
Even so, If my GPS is not working, "no GPS" should come up in the debug window, right? From what you can see is the code ready to run? The author mentions something in the prefix about removing part of the code for simplicity.
That should echo any received character to the terminal.