The embedded system has once again encountered new opportunities as it has transitioned from the isolated single-chip microcomputer era in the 20th century to the era of single-chip microcomputer and multi-science integration, and then to the current era of embedded Internet of Things. The GPS (Global Position System) time and space parameters are the national notarized engineering construction in the Internet of Things era. It provides accurate navigation, command, monitoring, timing and other services for aviation and navigation, scientific exploration, geographic measurement, transportation industry, and communication industry. This paper fully combines the STC single-chip microcomputer and Trimble's receiver to design a navigation and timing system. The system can provide real-time information such as the position and speed of the moving carrier, and can synchronously receive satellite time.
The system mainly has two functions: navigation and timing. The biggest advantage of the system is that it can display navigation information and time information through the LCD screen outdoors, and display satellite time and navigation information such as longitude, latitude, and altitude of the moving object through the upper computer human-computer interaction interface indoors. The system overcomes the shortcomings of the commonly used navigators, such as the cumbersome design, single function, and high cost utilization. On this basis, a simple, cost-effective, widely used, and easy-to-expand navigation system is designed. This provides great help for commonly used navigation and timing services.
1 System Hardware Design
1.1 Design Ideas
First, the GPS module sends GPS navigation data and satellite time to the STC microcontroller at regular intervals, and then the STC microcontroller processes the GPS navigation data and sends the data to the LCD display or PC. The structural block diagram of the navigation timing system is shown in Figure 1.
The core of the system is the GPS navigation module, and the processor is the STC12C5A microcontroller launched by Hongjing Technology. The GPS navigation module uses Trimble's Sierra GPS chip to receive satellite navigation information and timing services. The Sierra chip uses Trimble's unique GPS algorithm to ensure the accuracy of navigation data and the rapid locking of satellite signals. It can also effectively solve the problems of signal shielding, multipath and radio frequency interference that often occur in urban applications. STC12C5A is an enhanced 8051 core with ultra-low power consumption and super strong anti-interference characteristics, which provides great convenience for GPS navigation systems in outdoor surveys and field monitoring. The control device of this system is not complicated, nor does it require a large storage space. STC12C5A can control the entire system to save costs. In addition, STC12C5A has 2 serial ports that just meet the system requirements. The LCD display is the LMB102DDC display. The display is small, easy to control, clear, and low-cost, making it the best choice for the system.
1.2 Hardware Principle
Figure 2 is the GPS navigation circuit. The GPS navigation module provides real-time three-dimensional position and UTC time information, and sends data to the STC microcontroller through the GPS serial communication port B. The input/output levels of the GPS navigation module and the STC microcontroller are both TTL levels, so the serial ports can communicate directly. The baud rate of GPS data transmission can be 9600bps, 4800bps, or 2400bps, which can be selected at will.
[page]
Figure 3 is the interface circuit between STC12C5A and LMB102DDC. The LMB102DDC core module has an instruction register and a data register. Its instructions are divided into basic instructions and extended instructions. The instructions are mainly used to initialize the LCD screen and realize basic control. Among them, they include screen clearing settings, display position, cursor status, display status, function settings, etc. LMB102DDC can write data to RAM and read data from RAM. Here, it mainly writes data to RAM.
When the navigation system works outdoors, the STC microcontroller processes the received navigation data and time information, and then outputs the navigation longitude, latitude, altitude, and satellite time through the P0 port and displays them on the LMB102DDC LCD screen. When the navigation system works indoors, the STC microcontroller sends the received navigation information to the PC through the serial port. The PC views the relevant GPS navigation data and time information through the system's host software. Since the input/output level of the PC is different from the input/output level of the STC microcontroller, a MAX232 level conversion circuit must be added when the two communicate with each other. The main reason for not choosing LCD to display navigation information for indoor work is to save costs and maintain the integrity of the system. This is also the feature that distinguishes this navigation system from other navigation systems.
Another advantage of the navigation timing system is that it can calibrate the relevant information of the navigation system through the host software. A set of the latest time data (year, month, day, hour, minute, second) and the working mode of the software system are sent to the STC microcontroller through the serial communication interface in a certain format. The STC microcontroller uses this set of data to calibrate the erroneous information and change the working mode according to the sent settings. The host computer sending settings are shown in Figure 4.
[page]
2 System software design2.1 Design process
The software is the control center of the system. The system uses C language to write STC microcontroller programs in Keil uVision4 compiler. The program mainly includes receiving GPS data, processing GPS data, display control, etc. The main program flow is shown in Figure 5.
2.2 Control Program
After STC12C5A receives a complete set of GPS data through the serial port, the control program processes the GPS information accordingly. After processing, it is sent to the host computer through the serial port. During the whole process, two serial ports must be opened at the same time. The two serial ports of STC12C5A just meet the system requirements, and different baud rates can be set for them. The STC12C5A series of microcontrollers has expanded the RAM space by 1 KB, which is enough for this system as a temporary buffer. The system does not need to save a large amount of data. Although serial port 2 has been receiving GPS navigation data and timing data, serial port 1 is also sending data to the host computer at a higher baud rate. Finally, all data will be saved in the PC in .txt format through the host computer software. When setting the serial port interrupt priority, the control program will set the serial port interrupt for sending data to the highest priority, giving priority to serial port sending. When receiving GPS data, navigation information is received every 1 s, which will not affect the accuracy of navigation. The baud rate of the serial port for sending data is set to 115 200 bps, and the baud rate of the serial port for receiving GPS data is set to 9 600 bps. The initialization program code of the two serial ports is as follows:
The data processing part mainly determines whether the data sent by GPS to the STC microcontroller is valid. When the data is valid, the longitude, latitude, altitude, satellite date, and time information are extracted and saved in the character array. After the data is saved, it is determined whether the data is sent to the LCD display for display or sent to the host computer software for display through the serial port. The display modes include LCD display and host computer software display, and the default mode is LCD display. If the host computer interface needs to be in display mode, first set the "Display Mode" to 1 through the "Send Settings" dialog box in the host computer software, and then send it to the STC microcontroller.
[page]
3 Upper computer software design
The entire upper computer adopts a structured and modular design method. The upper computer software is designed based on the MFC application of the dialog box, which mainly includes the serial communication module, the navigation data and time display module, the working mode setting module, and the timing module. The function of the timing module is to synchronize the PC time with the satellite to ensure the accuracy of the PC time. The PC connected to the system can be used as a timing host to send time to other units.
The serial communication module is written using the serial communication MSComm control provided by Microsoft. After adding the MSComm control, the control must be initialized first, and then the serial port is opened to prepare to receive characters bit by bit. The main program code of the serial communication module is as follows:
The display module is to separate the received characters after the serial port receives the characters and display them on the software interface accordingly. The display effect of the upper computer software is shown in Figure 6.
4 Test results
After debugging, the system finally sends the navigation information to the host computer software, and the display result is shown in Figure 6. The time on the software interface is the Beijing time obtained by adding 8 to the UTC time obtained from the satellite. The longitude, latitude and altitude of the GPS data are the information of the navigation point. The number of satellites is the number of satellites currently searched, and the working modes are GPS mode and Beidou mode. The storage setting of the software is to store the complete data sent by the device end; the host computer sending setting interface is shown in Figure 4. It is mainly to set the display mode and calibrate the current data information of the device. Through testing, the whole system runs well and achieves the expected effect.
Conclusion
This paper designs a low-power, low-cost, multi-functional navigation and timing system based on STC single-chip microcomputer design. It mainly expounds the hardware design principle, main module circuit and software design process of the whole system, and gives a detailed introduction to the host computer software supporting the system. The system can be operated outdoors and indoors through testing, which provides great help for industries and timing systems that require navigation services.
Previous article:Industrial frequency meter based on Sunplus 16-bit microcontroller
Next article:Design of intelligent vehicle control system based on single chip microcomputer
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Introduction to Artificial Intelligence and Robotics (Murphy)
- MCU Principles and Interface Technology C51 Programming (Edited by Zhang Yigang)
- 51 Single Chip Microcomputer C Language Programming Classic Examples (2nd Edition) (Hou Yubao)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The difference between NB-IOT and Lora
- [TI High Precision Laboratory] In the course, when calculating the offset voltage error, is it not necessary to calculate the offset voltage error of the second-stage op amp?
- Does anyone know: Can one ZLL remote control control 3 ZLL lights at the same time?
- Does anyone have the Chinese version of the RL78F12 chip datasheet?
- Optimizing EMC and Efficiency in High Power DC/DC Converters Part 1
- Common Problems in RF Circuit Design
- Telink Microelectronics Matter Development Guide (I): The Past and Present of Matter
- Example of chip drain damage
- F280049C CAN_ex3 Issue
- [Factory Visit Live Replay] Arrived at the destination - TE Qingdao Factory