Design and implementation of GPS high-precision clock

Abstract: Introduce the design ideas and methods of using GPS and OEM receiver board to realize the precision clock system, and give the basic hardware circuit and software flow.

1 Overview

GPS (Global PosiTIoning System) Global Positioning System is a system of navigation, positioning and timing established by using signals transmitted by 24 GPS address satellites in the US The US government has promised that the GPS system will be free to the world for a long period of time in the future. At present, GPS systems are widely used in the fields of navigation, geodetic surveying, precise timing, vehicle positioning and anti-theft. Therefore, the research and application of the GPS system will greatly increase productivity and produce huge economic benefits. This article aims to design a high-precision clock system suitable for precise timing by using the function of precise timing provided by GPS and using single-chip technology.

GSU-16 is a parallel 11-channel GPS OEM receiver board produced by KODEN. Due to the use of advanced semiconductor design methods, it has excellent characteristics such as small size, low power consumption, stable performance and high cost performance. Using it, various GPS application systems can be developed conveniently and quickly. The main performance indicators are as follows:

Receive channel-11 channels receive in parallel, can track 11 satellites at the same time;

Timing accuracy-less than 400ns, no cumulative error;

Data update time-1s;

Volume and weight-65mm & TImes; 35mm, approximately 40g (including lithium battery);

Data output format-NMEA-0183 v2.0; RTCM-sc104 v2.0;

Ambient working temperature -30 ~ + 75 ℃;

Normal working parameters-voltage 5 (1 ± 0.05) V; current 100mA; power consumption 100mW.

2 GSU-16 hardware interface and software interface

(1) Hardware interface

GSU-16 also provides 12-pin interface (J3) and 5-pin interface (J4). In this design, 5 link ports J4 are used, and the functions of each pin are listed in Table 1.

Table 1

Interface number Signal name

Features

1 GND Power ground
2 backup in Backup power input, 2μA consumption at 3V
3 SD1 Serial output
4 RD1 Serial input
5 + 5V Main power supply input

The RD1 pin of GSU-16 is the communication interface of RS232C, and its logic level is TTL level. In this way, it can be easily connected to various single-chip computers without level conversion. At the same time, the 12-pin interface also provides high-precision second pulse output, which can be used in measurement systems that require higher precision timing services. Here, we only use its clock information, so we only need to extract it directly from the ASCII data it outputs.

(2) Software interface

The communication baud rate of GSU-16 is 4800, 1 start bit, 8 data bits, 1 stop bit, no parity. Usually output in NMEA-0183 format, the data code is ASCII code characters.

NMEA-0183 is a standard format developed by the American Marine Electronics Association for marine electronic equipment. Currently, V2.0 is widely used. Because the format is a string of ASCII codes, it is relatively intuitive and easy to handle. In many high-level languages, it can be directly discriminated and separated to extract the data that the user needs.

Among the main sentences of NMEA-0183, the most common formats are:

GPGGA GPS positioning data

GPGLL address location and latitude and longitude

GPZDA date and time

GPVTG Azimuth to ground speed

For example, GPZDA is a time and date output statement whose standard format is as follows:

As another example, $ GP GGA is a positioning navigation data output sentence, and its standard format is as follows:

In specific use, after receiving a message, you can use software to determine whether the message leader is "$ GPZDA" or "$ GPGGA" to confirm whether the received message is correct, and then extract the world from the message. It should be noted that adding 8 hours to the extracted world time is Beijing time, and the software must also process the world time from 16:00 to 24:00 to convert to the correct Beijing date and time.

3 Application circuit and programming

When designing the clock system, the single chip microcomputer we used was the MC68HC908GP32, a general-purpose chip from the MC68HC08 of Motolola. The chip has been widely used for its high performance, low power consumption, and low price. Its main characteristics are:

â‘ 32KB on-chip Flash memory, with online programmable capability and security function;

â‘¡512B on-chip RAM;

â‘¢ Enhanced serial communication port and serial peripheral interface;

â‘£Support C language.

The interface circuit can be designed according to Figure 1, and the program flow is shown in Figure 2.

The sample program of single chip microcomputer initialization is as follows:

SCBR EQU $ 0019

SCC1 EQU $ 0013

SCC2 EQU $ 0014

SCC3 EQU $ 0015

SCS1 EQU $ 0016

SCS2 EQU $ 0017

SCDR EQU $ 0018

TEMP EQU $ 40; define 1 byte temporary storage space

ORG $ 8000; define the starting position of the program

INIT: LDA #% 00100010; initialization begins

STA SCBR; baud rate definition

LDA #% 01000000

STA SCC1

LDA #% 00001100

STA SCC2

LDA #% 00000000

STA SCC3

START: JSR GETDATA; receive 1 character

STA TEMP; store it in temporary space

CMP # $ "$"; judge whether it is "$" character, if not START

...

; Judge whether it is GPZDA information module, if not, turn to START and re-receive

...

; Data receiving and processing module

...

; Clock driver and display module

...

; Return to START to receive the next set of messages

GETDATA: BRCLR 5, SCS1, GETDATA

LDA SCRA

RTS

4 Conclusion

The accuracy of the time signal is directly related to people's daily life, industrial production and social development. Due to the development and development of computer technology, network technology, communication technology, GPS positioning technology and other related technologies, as well as the reduction in the price of GPS OEM boards, the possibility of providing high-precision timing for various application fields is already available.

GPS precision clocks are mainly used in important public buildings in cities, such as stations, docks, parks, traffic intersections, sign buildings, etc. and mobile and fixed telephone timekeeping in the telecommunications industry. It provides accurate public time, facilitates people's daily lives, and avoids the inconvenience caused by inaccurate clocks. At the same time, it also opens up a better application for the application of GPS system, which has wide practical significance.

Seat Tube Battery

Seat Tube Battery,Inner Seat Tube Battery,Seat Battery Packs,Electric Bike Battery 24V

Changxing Deli Technology Co., Ltd. , https://www.delipowers.com