Welcome to GPS Module repository
GPS parsing output
1. Learning objectives
In this course, we mainly learn to use STM32F103RCT6 and GPS module modules to realize the location information analysis output function.
2. Prepare before class
The GPS module uses UART and USB communication, here use the UART port of STM32F103RCT6 to read the information, and connect the TXD of the module to the PA10 pin of the STM32F103RCT6 board.
VCC and GND are connected to the 5V and GND of the STM32F103RCT6, respectively.
3. Programming
The baud rate of the module is 9600
Read and parse the received data
Converts units of latitude and longitude information into degrees.
Print the received data through the serial port
Note: In fact, the coordinate system value of GPS/Beidou positioning is not a simple 100 times relationship, but needs to be converted once in degrees, minutes and seconds. Then the GPS/Beidou coordinate values we obtain, such as 2429.53531 north latitude and 11810.78036 east longitude, need to be calculated as follows:
24+(29.53531/60)≈ 24.49225517
118+(10.78036/60)≈118.17967267
And different single-chip microcomputers may have problems with data conversion accuracy and have certain errors.
4. Experimental phenomenon
After the module is powered on, it takes about 32s to start, and then the serial port printing status light on the module will continue to flash, and the data can be received normally.
After the program is downloaded, run it, open the serial port software, the baud rate is set to 9600, and the serial port will print the current location information in a loop.
Note: The module antenna needs to be outdoors, otherwise the GPS signal may not be searched.