2018-03-31 08:30 AM
Hey guys.
I would like to receive NMEA lines from my GPS module with UART with STM32L476 DISCOVERY. Can you please help me how can I receive the full sentences? Because the length of the lines always differ, so with simple HAL_UART_Receive I am not able to get them.
#gps #stm32 #stm32l4 #discovery #uart #usart #nmea2018-03-31 03:56 PM
https://community.st.com/0D70X000006SjgqSAC
2018-03-31 10:47 PM
https://stm32f4-discovery.net/2014/08/library-27-gps-stm32f4-devices/
2018-04-01 07:37 AM
The use of 32-bit floats in that code for latitude and longitude are likely to be problematic given the circumference of the Earth and that they only hold about 7 digits of precision. Towards the limits the resolution/granularity blows up to 1.7 metres, one should use 64-bit doubles.
Majerle.Tilen
Here is some code to crack $GPGLL
https://community.st.com/0D50X00009Xkh8gSAB
2018-04-03 06:38 AM
To recap for an easier start - receiving NMEA sentences is quite simple.
Sync onto the '$' character, and receive until '\r\n' (but expect corruption and drop-outs).
A 80 byte buffer used to work for me.
Don't do extensive parsing in the interrupt context, GPS receivers use to send in bursts.
I will confirm Clive's information. To be really precise (just like GPS marketing says), 10cm should be achievable, while in reality if we have 1.7m, we are good
AFAIK, about 1.5m is quite normal for a civilian receiver, which is usually arificially distorted.
And when the c r e e p s meet near to you, expect far less accuracy, or even drop-outs for days.
2018-04-03 08:03 AM
I will confirm Clive's information. To be really precise (just like GPS marketing says), 10cm should be achievable, while in reality if we have 1.7m, we are good
Please note that NMEA output is not ready for more than 7-digits precision.
2018-04-03 10:10 AM
>>
Please note that NMEA output is not ready for more than 7-digits precision.
That is nonsense, used GPS receivers for over a decade where we output to six decimal places, ie 12345.123456. Sure you can find NMEA receivers from the 1980's using 12345.1234 form but we're still talking >7 digits, and the float format doesn't care which side of the decimal point the digits are on, it starts counting from the left.
My point more specifically is the loss of least significant digits when using 32-bit floats. ie at close to 0.0 you have resolution to fractions of mm, and at 179.99999 degrees you have resolution steps of multiple metres. This will be compounded if you use any math with multiplication that explodes out the most significant digits and loses the the least. ARM floating point implementations don't hold intermediate values at higher precision.
>>AFAIK, about 1.5m is quite normal for a civilian receiver, which is usually artificially distorted.
Confusing accuracy with precision.
The Selective Availability 100m dither was turned off in 2000 by the Clinton administration. Civilian L1 GPS can deliver cm level accuracy with established carrier phase methods (>25 years)
2018-04-03 10:48 AM
The Selective Availability 100m dither was turned off in 2000 by the Clinton administration. Civilian L1 GPS can deliver cm level accuracy with established carrier phase methods (>25 years)
I guess you mean A-GPS. I didn't tinker with GPS lately.
Confusing accuracy with precision.
I intentionally not entered the 'precision' discussion. The LNG/LAT part of GPS sentences consists of degree, minute and second (or minute fractions) parts, which IMHO call for an integer representation ...