Any NMEA to binary converters for PIC?
#1
Posted 25 November 2003 - 08:43 AM
I have seen code that will read NMEA and spit it out to an LCD, but the data stays in ASCII. For the purposes of a UAV, however, a binary conversion is needed so that flight parameters can be calculated.
I have been working on such routines, but I'm not done yet, and I would like as much input as possible. If anyone has links, please post them.
Thanks,
Nathan
#2
Posted 25 November 2003 - 01:25 PM
So if you have it in hex lets say numeric 45 for instance is: 3435. In decimal that would be 52 53 (subtract 48 from each digit) = 4 5.
Get it?
Edited by mikep, 25 November 2003 - 01:26 PM.
#3
Posted 25 November 2003 - 01:58 PM
From what I have heard in prior discussions, the waypoint features built into the handheld GPS products have been used for this. That is to say, the consumer GPS units calculates it all for you and points you to the direction that you should travel via the NMEA sentences.... and calculate basic navigational parameters such as distance and angle to a waypoint.
The little OEM GPS modules do not have such features, which is one of the reasons they have not been popular around here. However, an external microcontroller that you could add your waypoints too would be a way to solve this. None have been mentioned though, so you might be on your own.
#4
Posted 25 November 2003 - 03:15 PM
http://abe.www.ecn.p...web_ssm/web_GPS
http://abe.www.ecn.p..._ssm/web_GPS_eq
If you don't know about WGS84 then start here:
http://www.wgs84.com/wgs84/wgs84.htm
#5
Posted 25 November 2003 - 10:06 PM
Thanks for the reply. What you describe is a conversion to unpacked binary coded decimal format. That's the first step in converting it to a useable binary, but you still have to convert the BCD to binary and scale it to a useable number. The degrees and minutes are different units, for example.If you mean that you want the "NUMERIC" value from an ASCII decimal value simply subtract 48 from each number.
So if you have it in hex lets say numeric 45 for instance is: 3435. In decimal that would be 52 53 (subtract 48 from each digit) = 4 5.
Get it?
Nathan
#6
Posted 25 November 2003 - 10:11 PM
I have OEM modules (Motorola oncore) and they don't support waypoint calculation. I'm mostly done with my code though, and I have plans to make it accessible to others. I was just hoping to compare my code with others and refine it with other ideas. Anyway, thanks for your input.The little OEM GPS modules do not have such features, which is one of the reasons they have not been popular around here. However, an external microcontroller that you could add your waypoints too would be a way to solve this. None have been mentioned though, so you might be on your own.
Nathan
#7
Posted 26 November 2003 - 04:36 AM
Use the formulas I linked to to convert to decimal degrees.you still have to convert the BCD to binary and scale it to a useable number. The degrees and minutes are different units, for example.
Take a look at this excel spreadsheet to get some examples.
http://abe.www.ecn.p...xls/web_GPS.xls
#8
Posted 26 November 2003 - 05:49 AM
I would like to see this as I have an Oncore and an old Trimble SVee6 OEM units.I have OEM modules (Motorola oncore) and they don't support waypoint calculation. I'm mostly done with my code though, and I have plans to make it accessible to others. I was just hoping to compare my code with others and refine it with other ideas. Anyway, thanks for your input.
Nathan
I have some code that does the opposite, binary to NMEA for some Askin-Seki units Mavin sold years ago. These only had a binary output.
#9
Posted 26 November 2003 - 07:11 AM
The links were pretty informative, but knowing the conversion formulas and proceedures, and actaully implementing them on an 8-bit uC are two very different things. I'm looking for the later of the two. I'd like PIC code that implements the conversion formulas.Use the formulas I linked to to convert to decimal degrees.
Take a look at this excel spreadsheet to get some examples.
http://abe.www.ecn.p...xls/web_GPS.xls
Thanks,
Nathan
#10
Posted 26 November 2003 - 07:17 AM
I looked at the Askin code for some time because it looked like it would do everything I'm looking for. They don't clearly state that the ouput of these units is binary, so I kept hunting aroud for the NMEA sentence parsing. Never found it though.I would like to see this as I have an Oncore and an old Trimble SVee6 OEM units.
I have some code that does the opposite, binary to NMEA for some Askin-Seki units Mavin sold years ago. These only had a binary output.
When I finish my code I will probably post it. If not, I can send you a copy directly.
Nathan
#11
Posted 26 November 2003 - 01:26 PM
I leave the 16-bit and 32-bit math to the high level compilers. But if you are set on ASM there might be something here that might help you.The links were pretty informative, but knowing the conversion formulas and proceedures, and actaully implementing them on an 8-bit uC are two very different things.
http://www.piclist.c.../math/index.htm
I understand this is not what you are looking for. But I have a feeling no one here as come across it, or they are not willing to share it. So I'm trying to provide you the pieces.
My ASM experience is limited to only "WHEN I HAVE TO" use it. Otherwise I would try and provide you with some more complete routines since this is stuff that also interest me. But I don't like torturing myself to get it to happend in ASM and prefer using high level languages.
Cheers,
Mike
Edited by mikep, 26 November 2003 - 01:48 PM.
#12
Posted 26 November 2003 - 04:57 PM
Yes, I've been using the piclist quite extensively for all of my routines. Eventually I should move up to a higher level language, but for now MPASM is free, universal, and forces me to understand what the PIC is doing.I leave the 16-bit and 32-bit math to the high level compilers. But if you are set on ASM there might be something here that might help you.
http://www.piclist.c.../math/index.htm
I understand this is not what you are looking for. But I have a feeling no one here as come across it, or they are not willing to share it. So I'm trying to provide you the pieces.
My ASM experience is limited to only "WHEN I HAVE TO" use it. Otherwise I would try and provide you with some more complete routines since this is stuff that also interest me. But I don't like torturing myself to get it to happend in ASM and prefer using high level languages.
Cheers,
Mike
As for the math, it turns out that all I've needed is a 32 bit addition and negate, a 16x8 multiply and an 8 bit arctangent. The full set of routines is right around 500K.
What compiler do you prefer, BTW?
Nathan
#13
Posted 26 November 2003 - 06:32 PM
Here is the 16F84 project for Askin binary to NMEA.I looked at the Askin code for some time because it looked like it would do everything I'm looking for. They don't clearly state that the ouput of these units is binary, so I kept hunting aroud for the NMEA sentence parsing. Never found it though.
VK2GWK's page
#14
Posted 26 November 2003 - 06:52 PM
I use both PicBasic Pro and CCS C.What compiler do you prefer, BTW?
I don't really have a preference but lately have been using the PBP more. Simply because I've been in touch with people that use it. I actually have a lot more experience in C/C++.
Somewhere I read about a C compiler available on Microchips site, but I haven't looked into it. I have enough on my plate with the one's I have! :-)
#15
Posted 06 December 2003 - 02:23 PM
#16
Posted 01 February 2009 - 05:19 PM
Hi all, I have scoured the net for some time in search of code for a PIC (preferably in assembly) that can parse NMEA sentences, convert the data to a binary format, and calculate basic navigational parameters such as distance and angle to a waypoint. I keep thinking that SOMEONE must have tackled this task already, but I have yet to find it. Does anyone have links to such a project?
Well, it looks like I am about 6 years late, but here is a project that does just that. MikeP originally wrote some of the base autopilot code, and I added the internal navigation code, etc. It does it on a PIC16F, and can keep up with GMRC on a 5 hertz GPS. Parsing is done with PicBasic, and the navigation math is done with assembly. Having trouble parsing an additional sentence at that speed though.
http://www.rcgroups....ad.php?t=993046
Edited by radiohound, 02 February 2009 - 02:44 PM.


