Help! Can't display NMEA strings with BS2Px properly

Hi Guys,

I am starting small by first trying to display live data to a 2 X 16 Serial LCD and the debug window. I am copying, pasting and editing code to try and achieve this. So far I have learnt a lot! I am using a BS2Px and a EB-85A GPS receiver.

Below is a sample of the strings that my GPS module is outputting.


(Now that you know where I live you can send your UAV to take a picture of my house!)

If you look at the attached photo you can see that the string and the info displayed from the BS2 don't match up?
I think I might have a serial connection setup wrong somewhere. I have included in the circuit a 22K resistor to the serial in as described in the BS2 Help file.

If any one has any ideas please help as I have been trying this for hours!

Thanks in advance!


Views: 601


Reply to This

Replies to This Discussion

That's really odd. Can you upload a screenshot of your BS2 debug terminal showing raw NMEA and parsed sentences-c? That will reveal if there's a serial problem.

SERIN [pin],[baud],[WAIT("$GPGGA"),SPSTR 65]

should do it, once you replace pin and baud with the right figures for your setup.

Thanks Chris,
Is this what you mean, not sure on how to display that in the debug window.
To read that, run a FOR loop along these lines;

FOR n = 0 TO 65
GET n, temp
This is weird!
Are you sure your GPS is in NMEA (ASCII) mode and not binary? That sure looks like binary (via a DEC filter) to me...
Sorry for the slow reply, work keeps getting in the way!

I don't know if I am heading in the right direction or not but this is what I have done so far.
I connected both my EM406A and EB85A GPS units to Hyper terminal to see if they were outputting the same thing. see below.

Here it looks like ASCII? On the EB85A I can't see any option either in the software or via direct serial commands to change the serial output to or from ASCII to Binary? However on the EM406A this can be changed by sending it a string. Could I have something wrong in the Basic Stamp code that is giving my this error?

Now I am really confused! :(

Any Ideas?? Thanks in advance, again!
Sorry, I gave you the wrong DEBUG modifier. DEBUG defaults to ASCII and if you use the DEC filter it will give the number value of the ASCII codes, which may be what you were seeing. (I made the mistake because when you're inputing the data with your original SERIN command, which puts the values into variables, you actually do want to use the DEC modifier when outputting in DEBUG. But when you're taking it in byte by byte, as SPSTR does above, you want to output it in ASCII. )Confusing, I know, but the below should work:

FOR n = 0 TO 65
GET n, temp
DEBUG temp
This is a bit better!
In the debug window, the string is flashing on (strobing) quickly then it disappears again until it reads the string again. It also looks like that some times only half the string is there. This happens every 4th or 5th time. I managed to take a screen shot and caught it while it was displaying. the first part look a bit weird but the rest look ok. (when it is all there) I am going to solder up the leads for the EM406A and try it with the stamp. I am starting to wonder if the issue has something to do with the EB-85A being 5Hz and the stamp can't keep up.
That actually does look like a serial problem (the screen "flashing" is just random ASCII characters that tell the terminal to clear the line or start from the top left, etc). You did change your baud rate constant for your BS2px, yes? Our code is all written for a BS2p, where the code for 4800 baud is 500. For the BS2Px that code is 813 (it's all in your help file or other documentation under SERIN).

If you haven't made that change, try it and let us know if that fixes the problem.
I checked all the serial baud rates a few days ago and found the table where you can work out which number for any baud rate.
I just soldered up the leads to connect my EM406A to the Basic Stamp. I then changed the baud rate to suit the EM406A and guess what, it worked first time!
I am now waiting for a cable to be delivered so I can connect the EB85A to the GPS dev board to change its settings. Maybe 5Hz was too fast. I will slow down the baud rate to 9600 and change it to 2HZ and then give it a go! I'll let you know how it goes. Hopefully it could save someone else having to work all this out.

Thanks for all your help Chris!

BTW, I downloaded this software last night and tried it out today on my laptop while driving around in the car. (using a wireless broadband card). It works great! Now I want a wireless data modem as well! :)

Reply to Discussion



Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service