Continue to Site

# PIC18 + GPS Help

Status
Not open for further replies.

#### Toonzaka

##### New Member
Hello, I recently purchased a Garmin 18x LVC GPS unit to use with my micro controller. I am using a PIC18 with to communicate to the GPS unit and hyperterminal to see the data. Now I am running into some problems. For one, I am very new to GPS, this is actually the first time I am working with one and I have no idea if this unit is on or off because I am not receiving any data from the unit even after 5 minutes.

Now for the controller, as I said I am using a C-Stamp micro controller that uses a PIC18. I am not sure if anyone on this forum is familiar with that controller but it has its own syntax for sending/receiving info. I am using two simple lines that SHOULD receive any data from the GPS unit but it is not. I a, also using MATLAB and the C18 compiler.

I have a few questions now as well...

4) Get the PIC to light the LED briefly when it receives "$GPRMC". That should give a flash once a second. Then you can start looking at the data in more detail. #### Toonzaka ##### New Member Thanks Diver I will try that as well... And like I said I have to use a C Stamp I don't have a choice... #### Toonzaka ##### New Member Alright I purchased a db9f and was able to read the GPS data on Hyperterminal. I thank all of you for the help again! The next step I believe is parsing the data and getting the Stamp to read each of the lines which I should be able to do. Again I will keep everyone updated and I really appreciate all of the help. Thank you all so much! #### Oznog ##### Active Member Thank you Oznog, I wish I could just use the PIC18 but I am forced to use the Stamp. I will try all of your suggestions. And thank you everyone for the help and I will keep up to date with my progress. What situation is forcing the use of Stamp? You may need to send commands to the GPS soon. You'll have to format the command exactly, including a checksum. This is kind of a pain because when you screw something up, it's hard to know what was screwed up because nothing happens (the GPS typically rejects any sentence with a bad checksum or invalid formatting). Takes a little while. Best to check your checksum generator on sentences coming FROM the GPS, it's the same method. #### Diver300 ##### Well-Known Member Most Helpful Member There are lots of GPS strings. However all the GPS receivers that I have seen have a default set that includes:$GPRMC (lat, long, date, speed and track)
$GPGGA (lat, long, height and horizontal position error)$GPGSA (satellites in view, signal levels, horizontal and vertical position error)

(\$GPGSA is often only transmitted every 5 seconds, and it may need several strings to list all the satellites)

The point is that those include all the information that you want in just about all circumstances.

The GPS protocol allows for a whole load of things that you never need nowadays. For instance, you can tell a GPS receiver a destination, and it will tell you a course and distance to that destination. I can't see why you would want that as you might as well get the PIC or C-Stamp or whatever to do that calculation itself, as the PIC or C-Stamp must have the position of the destination in order to send it to the GPS, and it's easier to get that to do the calculation.

Therefore you can almost certainly read the default strings and get all the data you want without ever sending data to the GPS.

If your GPS receiver doesn't have an internal battery to record the ephemeris data, it gets more complicated if you want a fast fix. However, the only GPS receivers like that are basic GPS engines that are circuit level modules, not consumer products in a pretty case.

#### Toonzaka

##### New Member
I was wondering really quickly if anyone knew what the GPS units data is received as by the microcontroller? Is it a string or just plain ASCII?

Status
Not open for further replies.

Replies
15
Views
3K
Replies
27
Views
3K
Replies
12
Views
5K
Replies
10
Views
1K
Replies
20
Views
9K