Getting Started with GPS?

sciguy77

Member
Hi,

I want to get started with using GPS with picaxe, but I'm not really sure where to start. I want to start off connecting a GPS receiver (I'm thinking this one: http://www.sparkfun.com/commerce/product_info.php?products_id=8975) with an 18x standard project board and then have the current coordinates displayed on a LCD (I'm thinking this one: http://www.sparkfun.com/commerce/product_info.php?products_id=255). I have a good idea as to how to wire up the hardware, but I have no idea how to code this. My 2 questions are:

1) Will this hardware work together?
2) How the heck do I code this?

Thanks!
 

womai

Senior Member
As for the hardware I'd recommend a 28X2 rather than an 18X. The reasons is that the GPS sends pretty long strings of data - which are easy to receive with the 28X2's background serial receive (where the 28X2 reads all incoming data into the scratchpad, from where you can process them pretty much at leisure), but it's a pain on the 18X which neither has background serial nor a scratchpad nor much RAM.

Other than that, you should be fine hardware wise.

As for coding, for receiving data from the GPS have a look at hsersetup and hserin in the Basic manual; for the LCD display serout or hserout is what you need.
 

sciguy77

Member
Can you recommend a low cost board for the chip then?

I was hoping to do it with the 18x standard project board seeing its only $10.
 

MPep

Senior Member
@Womai,
Please remember that many of us have already done just the type of project that SciGuy77 is talking about on a 18X, and 28X.
I have even done some work for NMEA on a 08M!

@SciGuy77,
I would keep using the 18X that you have now. The only sentence that you would need is GLL, which contains only Lat/Long info.
Using Serin, it is easy enough only put into RAM (B0, B1, etc) the data you require. To skip some data, I have used repeated B0's in order to use only 1 RAM location to 'update' with several data characters. Think commas.
There are examples on the fourm. Do a search. I am certain you will find what you need. :D
Good luck.

MPep.
 

womai

Senior Member
@Womai,
Please remember that many of us have already done just the type of project that SciGuy77 is talking about on a 18X, and 28X.
I have even done some work for NMEA on a 08M!
Hi MPep,

I am aware of that. That's why I didn't say "it's impossible", but rather "it's a pain". With sufficient experience one can do amazing things on barely appropriate hardware, but it's often not very straightforward. sciguy stated "I have no idea how to code this" so that sounded to me like he is more or less a beginner in that domain (no offense if that is not true!). I'd hate seing somebody discouraged or failing just because he tried the difficult route first because he did not know there was an easier way. At least that's how I usually approach a new project - get it working in the most straightforward way first, and only then think about tweaks and tricks.
 

MPep

Senior Member
SciGuy77,

Search for "GPS NMEA". That will come up with a few interesting results.
Click here for more info Look at the last few pages.

@Womai,
I understand where you are coming from. My interpretation was that SG77 already had the hardware. No need to spend his hard-earned cash if he already has what is required.
SG77: maybe you can clarify this.

MPep.
 

MFB

Senior Member
Get started with simulator?

You can get a pretty good feel for GPS decoding before you purchase a unit by using a simulator.

The Near Space column in the July issue of Nuts & Volts magazine has a useful article about an 08M based GPS simulator, which generates GGA sentences that mimic the output from a balloon flight.

You can download the code from the www.nutsvolts.com.
 

papaof2

Senior Member
I want to get started with using GPS with picaxe, but I'm not really sure where to start. I want to start off connecting a GPS receiver (I'm thinking this one: http://www.sparkfun.com/commerce/product_info.php?products_id=8975)
That GPS outputs 5 messages per second. You probably don't have enough "horsepower" to process the messages that quickly. Check the documentation for the GPS to determine whether you can slow it down to the standard 1 message per second - at least until you have it working...

John
 

MPep

Senior Member
@PapaOf2,
It doesn't really matter how many sentences are sent per second.
Each one has a different identifier, ie GPGLL, GPRMC, GPZDA etc.
If you use Serin with RMC as the accepted qualifier, then ONLY that sentence gets looked at.
Example code
Code:
serin GPS_in,Baud,("RMC,"),b0,b1,b2,b3,b4,b5,b6,b7
To first start testing, connect a GPS and receive the information.
In order to know what information you have received, use SERTXD. This way the received data can be observed in a terminal, press F8 within Programming Editor.

Hope this helps.
 

sciguy77

Member
Wow, it looks like we've got a good little debate doing here. I do already have the 18x on hand, along with a bunch of 08Ms and the like. However, I wanted to check with you guys first before ordering the GPS module and LCD screen.
The LCD suggested in post #1:
http://www.sparkfun.com/commerce/pro...roducts_id=255
has a parallel interface.

Perfectly “do-able”,
but, requiring a further level of programming, processing
and hassle.

Would paying a few more dollars, for a Serial Interface LCD
prove a better investment?
I'm glad I did, can you guys recommend a different Sparkfun LCD screen that would be better?

And yes, I am on a quest for simplicity, at least for now. :)
 

sciguy77

Member
Ok, I put the 20 channel in the cart instead of the 32 as you recommended. Now all I need is a good LCD and I'm good to go. Any recommendations?
 

MPep

Senior Member
Hi SciGuy77,

Not so much a debate as trying to give you information that is useful.
Seeing as you already have a 18X, stay with that. You can do what you originally mentioned, display Lat/Long. Shouldn't be too big a job. Good luck.

Don't ever hesitate to ask questions :D.

MPep.
 

hippy

Ex-Staff (retired)
Not entirely sure what the 'big number mode' is but most text LCD's can display large numbers by using suitable block characters to build up 'pixels' so a number is shown across multiple character positions and lines. The AXE033 can do that.
 

kewakl

Senior Member
Not entirely sure what the 'big number mode' is but most text LCD's can display large numbers by using suitable block characters to build up 'pixels' so a number is shown across multiple character positions and lines. The AXE033 can do that.
I linked a pic from PH's site

Yeah, I'm sure. But PH has some extra chars for the diagonal parts of numbers (like the 7 shown)
 
Last edited:

hippy

Ex-Staff (retired)
The 'diagonals' are most likely user defined charcaters. Once those shapes have been defined and sent to the LCD they can be used just like any other characters.

The 'g' character on that display ( which I always think looks out of place on most LCD's I've used ) can be changed in a similar way. Once defined all that's needed is to send the new character code instead of the code for 'g'.
 

kewakl

Senior Member
The 'diagonals' are most likely user defined charcaters. Once those shapes have been defined and sent to the LCD they can be used just like any other characters.

The 'g' character on that display ( which I always think looks out of place on most LCD's I've used ) can be changed in a similar way. Once defined all that's needed is to send the new character code instead of the code for 'g'.
'redefining chars' do not know if my serlcd allows this.
the firmware is on a 16F688. The source is distributed, but I am 'C' -illiterate!:eek:
will look at your site for ideas.

Yes, the 'g' is too high! On my lcd, there appears to be another line of pixels below the chars
 

eclectic

Moderator
For us "lucky" Brits that own an AXE033.

Code:
#picaxe 18X
gosub setup

serout 7,n2400,(254,1)
pause 500

serout 7,n2400,(254,128) ; top line
pause 50

serout 7,n2400,(8,10,8," ",12,8,14," Hippy")

serout 7,n2400,(254,192); bottom line
pause 50
serout 7,n2400,(" ",10," ",12,11,8,13,14,"     ",15)

stop

setup:
serout 7, N2400, (254, 64, 63, 63, 63, 63, 32, 32, 32, 32) ; top half 8


serout 7, N2400, (254, 72, 32, 32, 32, 32, 63, 63, 63, 63) ;bottom 9
serout 7, N2400, (254, 80, 63, 63, 63, 63, 63, 63, 63, 63) ; All 10
serout 7, N2400, (254, 88, 63, 62, 62, 60, 60, 56, 56, 48) ;topleft 11
serout 7, N2400, (254, 96, 33, 35, 35, 39, 39, 47, 47, 63) ;botright 12
serout 7, N2400, (254, 104, 63, 47, 39, 39, 39, 35, 35, 33) ;topright 13
serout 7, N2400, (254, 112, 48, 56, 60, 60, 60, 62, 62, 63) ;botleft 14

serout 7, N2400, (254, 120, 32, 49, 36, 36, 32, 49, 46, 32) ;smiley 15
return
Made using the LCDgram wizard.
e
 

Attachments

hippy

Ex-Staff (retired)
Yes, the 'g' is too high! On my lcd, there appears to be another line of pixels below the chars

That last line is usually the eighth byte of 'pixel' data used for CGRAM characters and can be often be used and allows better 'true descenders' and top of character alignment for g, j, p, q and y.

The limit is usually only 8 user-defined CGRAM characters so depending on what's being displayed you have to pick and choose which to use. Clever re-programming on-the-fly can update CGRAM so you can have different on each screen but only ever 8 in total.

@ eclectic : Thanks !
 
Top