News:

;) This forum is the property of Proton software developers

Main Menu

GPS code - Puzzled

Started by RGV250, Oct 22, 2021, 10:33 AM

Previous topic - Next topic

RGV250

Hi,
I tried to compile and old GPS file (from around 2005) that I used and after changing the device, adding declare, changing optimiser level etc it compiled but did absolutely nothing. After ages I still could not get it to work and could not see any reason why.
I then found a newer file (around 2011) which was on the Amicus18 site somewhere which compiled and works, I really do not understand where the problem is.
It is not an issue as I can use the newer file but for my sanity I wonder if anyone who has an Amicus18 and GPS module could try the 2 codes out to see if they have the same issue.
GPS_Shield_2 works, GPS_Parse does nothing at all but I am sure it did on older devices.
GPS_PARSE.zip
GPS_Shield_2.zip

Regards,
Bob 

trastikata

I've never used that code, but in my own parser code I noticed that the comma sign is causing problems whereas replacing it with the corresponding ASCII code solves the problem. Might not be the same in your case though.

If GPS_CHAR = "," Then ... becomes If GPS_CHAR = 44 Then ...


RGV250

Hi,
I tried it but no difference, both codes use "," and one works. I am sure the one that does not work used to work with an older device (18F4620) but cannot prove it now as I do not have the board.

Bob

John Lawton

Check the assembler, identical code whether using for "," or 44 at least on my 18F24J50 board.

top204

#4
As John stated, the value of 44 is the value of the ASCII character ",". In the assembler code, characters are not used, and their ASCII value is always used.

Bob. Since 2005, an awful lot has changed in the compilers, so to try and see what is happening inside the original code, output the strings that are received from the GPS unit to a serial terminal, then add extra HRsout commands to see where the code is going wrong.

Also remember, the NMEA string format does change slightly from device to device now, and some strings do not have a 0 parameter value, but instead place an empty comma pair. The original 2005 code probably does not cater for this because GPS was then quite new for experimenting with and most GPS units placed values between all commas.

The Amicus18 GPS code I wrote back in 2011 is also now outdated and could easily be converted to use procedures, in order to make it a true library. :-)

RGV250

Hi Les,
I agree that the 2011 code is a lot better and I do plan to use it and add procedures.
However, I was really puzzled as to why the original code did not work and had to persevere just for my own curiosity. I did finally get it working and it was mainly due to commas and the numbers of the position in the array due to the NMEA having hundreds of seconds it put everything out by 3. The other bit that really did not help is if there is no fix type it does not send any data out and I had no signal where I was working on it. It seems like a waste of time but I enjoyed the challenge either way.

Bob

Giuseppe

Sometimes it is better to waste some time trying to understand where the error is, also for personal satisfaction