Design and implementation of GPS clock based on ATmega128

Publisher:学富五车Latest update time:2012-01-09 Keywords:GPS Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

GPS (Global Positioning System) is a navigation, positioning and timing system established by using the signals transmitted by 24 GPS earth satellites in the United States. At present, the GPS system is widely used in the fields of navigation, geodesy, precise timing, vehicle positioning and anti-theft.

GPS timing is one of its main functions. The accuracy of the time signal is directly related to people's daily life, industrial production and social development. In order to meet the needs of precise positioning and navigation, the GPS clock established its own dedicated time system at the beginning of system design and experiment. The system is abbreviated as GPST, which is kept and timed by the high-precision atomic clock of the GPS master station. Due to the development of related technologies such as computer technology, network technology, communication technology, GPS positioning technology, and the reduction of the price of GPS OEM boards, GPS clocks have the possibility of providing high-precision timing for various application fields.

This paper aims to design a high-precision clock system suitable for the need of precise timing by utilizing the precise timing function provided by GPS and using single-chip microcomputer technology, and display it through LCD.

2. GPS timing principle

The GPS time system is a time system defined and used by the GPS system. The satellite positioning system uses time as the basic observation quantity. Since the satellite flies at high speed, the time system must be very accurate, otherwise it will cause a large distance error. The GPS time system uses the atomic frequency standard as the time reference and takes 0:00 on January 6, 1980 as the starting point. It does not have leap seconds, and its time can be kept within 100 microseconds of the coordinated time. The error is announced regularly, and the satellite clock error published in the ephemeris file is the clock error relative to the GPS time system.

The basic principle of GPS timing is: the satellite continuously sends its own ephemeris parameters and time information. After receiving this information, the user calculates the three-dimensional position, three-dimensional direction, movement speed and time information of the receiver. Here, only the time information of the GPS timing system is needed. If (x, y, z) is the position of the receiver, (xn , yn , zn ) is the position of the known satellite, then solving the following equation can get x, y, z and standard time T:

(x-x 1 ) 2 +(y-y 1 ) 2 + (z-z 1 ) 2 =C 2 (T+ T-T 1 - 1 )

(x-x 2 ) 2 +(y-y 2 ) 2 + (z-z 2 ) 2 =C 2 (T+ T-T 2 - 2 )

(x-x 3 ) 2 +(y-y 3 ) 2 + (z-z 3 ) 2 =C 2 (T+ T-T 3 - 3 )

(x-x 4 ) 2 +(y-y 4 ) 2 + (z-z 4 ) 2 =C 2 (T+ T-T 4 - 4 )

Where △T is the time difference between the user clock and the standard time of the GPS master clock; Tn is the transmission time of the signal transmitted by satellite n; and is the time difference between the atomic clock on satellite n and the standard time of the GPS master clock [1] .

3. System composition and hardware and software implementation

3.1 Introduction to the GPS board used in this design

This design uses the A12 GPSOEM receiver board produced by THALES-NACIGATION. It uses advanced semiconductor design methods and has excellent characteristics such as small size, low power consumption, stable performance, and high cost performance. It can be used to easily and quickly develop various GPS application systems. Its main performance indicators are as follows:

Receiving channel: 12 channels of parallel reception, capable of tracking 12 satellites simultaneously;

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

Data update time: 1s;

Size and weight: 39mm×60mm×10mm, approximately 40g;

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

Ambient operating temperature: -30℃~+80℃;

Normal operating parameters: voltage 5 (1±0.05) V; current 70 mA.

Figure 1 GPSOEM board A12

The GPSOEM board provides hardware interfaces as shown in Table 1:

Pins

Signal Type

Function

1

VCC

power supply

2

V_ANT

Antenna power interface

3

V_BACK

Backup power supply

4

GND

land

5

RTCM

Receive signal port B

6

RXD

Receiving signal port A

7

TXD

Send signal interface A

8

1PPS

1 pulse output/second

Table 1 GPS output interface definition

The output data logic level is TTL level, so it can be easily connected to the microcontroller. The format bit defaults to: baud rate 4800, 8 data bits, 1 stop bit, no parity bit. GPS output data is output in NME-0813 format, and the data code is ASCII code characters. This design uses the RMC format in NME-0813. The following is a set of data output by GPS: $GPRMC,140736.00,A,3800.9040,N,11226.5364,E,00.0,355.6,121106,04,W,D*3B, where 140736.00 represents 14:07:36.00, and 121106 represents November 12, 2006. According to system requirements, we need to extract this data. The time obtained by GPS is Greenwich Mean Time (zero time zone). To obtain Beijing time (Eastern Time Zone 8), you must add 8 hours to the extracted world time to obtain Beijing time.

3.2 System composition and implementation

The system uses ATmega128 microcontroller, which has rich external resources, and uses its USART1 to communicate with the GPS receiver:

Its overall hardware connection is shown in Figure 2.

Figure 2 GPS clock implementation structure

The LCD display uses a 3510i color LCD display with a controller S1D15G14. The S1D15G14 comes with an LCD driver with an LCD power drive circuit, which can achieve color display on a single chip, can display 4096 colors, and the resolution is 98x67. It is connected to the microcontroller ATmega128 via a serial port.

The main program extracts GPS data using the query method [2] ,

Figure 3 Program flow chart

GPS clock is implemented by software on ATmega128 [3] (where the LCD function is the display function):

if(USART1_Receive() == '$') // USART1_Receive() is the serial port receiving function

{  while((gps_data_buff[counter ++] = USART1_Receive()) != '*');

data = 1; j = 0; i = 0; //Receive data and put it into gps_data_buff[ ] array

for (i=0;i<69;i++)

{if(gps_data_buff[i] == ',')

{     data ++ ; j = 0;

}

switch(data)

{     case 1: break;

case 2: time[j ++] = gps_data_buff[i + 1];time[j] = '' ; break;

case 3: break;

case 4: break;

case 5: break;

case 6: break;

case 7: break;

case 8: break;

case 9: break;

case 10: day[j ++] = gps_data_buff[i + 1];day[j] = '' ; break;

default: break;

}

}

LCD_FillArea( 0, 0,98,67,COLOR_WHILE); // LCD screen refresh function

LCD_WriteSpecHZ_GPS_time(2,0,COLOR_BLUE); // LCD displays time in Chinese characters

LCD_WriteEnglishString(2,16,time,T_TS,COLOR_BLACK,0); //LCD display time

LCD_WriteSpecHZ_GPS_day(2,32,COLOR_BLUE); //LCD displays the date in Chinese characters

LCD_WriteEnglishString(2,48,day,T_TS,COLOR_BLACK,0); //LCD displays date

}

The final result is shown in Figure 4 below: The displayed time is 10:09:00.00 on December 15, 2006

Figure 4 GPS clock extraction and LCD display effect

4. Conclusion

The author's innovation is to use ATmega128 to extract GPS high-precision clock and realize the display of GPS clock on LCD, which has the characteristics of high accuracy, low cost and easy implementation. GPS precision clock is mainly used in important public buildings in cities, such as stations, docks, parks, traffic intersections, landmark buildings and other places, as well as mobile and fixed telephone timekeeping in the telecommunications industry.

References:

[1] Song Wenguang, Wu Chunxue, Jiang Qiongqin. GPS timing function and its application in inland waterway navigation[J]. Microcomputer Information, 2006, 9-1: 258

[2] Gui Chengkun, Wu Linda. Design and implementation of an automatic clock based on GPS time source. Shiyan: Journal of Hubei Automotive Industry College. 2004, 6

[3] Gao Xiang, Tao Wei. Design and implementation of GPS high-precision clock for DSP system. Beijing: North China Electric Power Technology, 2003, 8

Keywords:GPS Reference address:Design and implementation of GPS clock based on ATmega128

Previous article:Application of AVR single chip microcomputer in multi-circuit data acquisition device
Next article:Design of intelligent voice system using ISD2500 and ATmega8 microcontroller

Recommended ReadingLatest update time:2024-11-16 20:57

Ultra-small single-stage amplifier LNA for GPS
Ultra-small single-stage amplifier LNA for GPS TOREX SEMICONDUCTOR LTD. has launched the XC2401A8167R-G, an ultra-small single-stage amplifier 1.6GHz LNA (low noise amplifier) ​​suitable for GPS using CMOS technology. In order to expand the LNA product lineup suitable for GPS, Torex Semiconductor has developed a l
[Analog Electronics]
Ultra-small single-stage amplifier LNA for GPS
ATmega128(ICC7.22 "delay.h")
//******************************************************************** /*Function name: delay_us Compilation environment: ICCAVR7.16A Function: microsecond delay program Description: 7.3728M crystal oscillator ************************************************************/ void delay_1us(void); void delay_3us(void
[Microcontroller]
Garmin Launches DriveSmart GPS Navigator with Larger Display and Easier Operation
On October 13, Garmin® International, a subsidiary of Garmin, announced the launch of a new series of portable in-vehicle GPS navigators: Garmin DriveSmart™ 66, 76 and 86, designed to increase the ease of operation and freedom of drivers. With a clear 6, 7 or 8-inch high-definition display, the Garmin DriveSmart ser
[Automotive Electronics]
Garmin Launches DriveSmart GPS Navigator with Larger Display and Easier Operation
Correctly measure wireless communication signals and perform EMC analysis
With the rapid development of wireless communication technology and the continuous evolution of specifications over the past decade, various wireless technologies, whether GSM, GPS, WLAN (such as Wi-Fi), Bluetooth, etc., have gradually emerged and become popular in daily life. Wireless communication technology itself i
[Test Measurement]
Correctly measure wireless communication signals and perform EMC analysis
51 MCU decoding GPS 1602 display
Use 51 MCU to analyze the information sent by the serial port GPS module, display it on 1602 LCD, and connect the TXD port of 51 MCU to the RXD port of GPS module. The program is slightly modified and some errors are corrected. This is the circuit schematic. The program was modified based on my microcontroller board. 
[Microcontroller]
Research and design of a data acquisition and processing system based on GPS
  O Introduction   GPS (Global Positioning System) is widely used in the fields of positioning, navigation, distance measurement, timing remote sensing, etc. with its high precision, all-weather and all-day characteristics, and has been rapidly developed. Design a GPS positioning data acquisition system based on emb
[Microcontroller]
Research and design of a data acquisition and processing system based on GPS
Design of car anti-theft system based on GPS-GSM SMS
  0 Introduction   There are a large number of car theft cases in my country every year. According to the statistics of Beijing Traffic Management Bureau, there were more than 10 car theft cases in Beijing every day in 2006, which seriously endangered the property safety of the people. In recent years, the number of
[Microcontroller]
Design of car anti-theft system based on GPS-GSM SMS
Design and implementation of GPS receiver based on ARM core
0 Introduction As a mature navigation and positioning technology, the Global Positioning System (GPS) has become more and more widely used due to its remarkable features such as all-weather, high-precision, automation, and high efficiency, as well as its unique positioning navigation, timing and frequency, prec
[Microcontroller]
Design and implementation of GPS receiver based on ARM core
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号