搜索
bottom↓
回复: 19

制作51单片机+LCD1602 的GPS数据显示器 编程 正确显示国际协调时间(UTC)、北京时间(BJT

[复制链接]

出0入0汤圆

发表于 2010-7-8 17:27:02 | 显示全部楼层 |阅读模式
制作51单片机+LCD1602 的GPS数据显示器 编程 正确显示国际协调时间(UTC)、北京时间(BJT),是有规律的:

//=============================================================================
Serial Time Output
Both the TSIP and NMEA protocols include time messages. See Report Packet 41 in Appendix A for a description of the time reports for each protocol.

Note – GPS time differs from UTC (Universal Coordinated Time) by a variable, integer number of seconds UTC=(GPS time)-(GPS UTC offset).

As of April 2002, the GPS UTC offset was 13 seconds. The offset has historically increased by 1 second about every 18 months. System designers should plan to read the offset value as a part of the timing interface to obtain UTC. The GPS week number is in reference to a base week (Week #0), starting January 6, 1980.
//=============================================================================

大致意思是,国际协调时UTC=(GPS time)-(GPS UTC offset).
2002年4月,GPS 时间与UTC 时间的偏差时间(GPS UTC offset)为13秒,按时间延续每18个月增加1秒,
我按照上面的内容推算,2010年,偏差时间(GPS UTC offset)为18秒

如果按上述资料理解,能确定其规律是对的,51编程时根据当前的GPS的年月数据信息,自动修正偏差时间(GPS UTC offset) ,就可以得到UTC时间,也就可以得到准确的、时分秒都不差的北京时间(UTC+8时区)。

有关GPS 的资料(见46页)如下:
点击此处下载 ourdev_566764S04CML.pdf(文件大小:946K) (原文件名:Lassen SQ Lassen SQ Manual.pdf)

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出0入0汤圆

 楼主| 发表于 2010-7-16 13:44:55 | 显示全部楼层
世界上各种时间关系的知识,请打开如下链接网页:
http://stjarnhimlen.se/comp/time.html
会有一些启发。



T I M E S C A L E S
By Paul Schlyter, Stockholm, Sweden
email: pausch@stjarnhimlen.se WWW: http://stjarnhimlen.se/

--------------------------------------------------------------------------------
1993? First version as an ASCII document.
1995 and on: Posted on Usenet several times and became part of the sci.astro FAQ part 3
2004-09-?? First HTML version, for an article in the Swedish ham radio magazine QTC
2005-04-19 Replaced obsolete links with working ones
2005-06-22 Major overhaul: corrected several small errors, updated tables, added new links.
Thanks to John Stockton (http://www.merlyn.demon.co.uk/) for a number of suggestions to this page.
2005-07-10 Added a link to Steve Allen's detailed history of the time scales.
--------------------------------------------------------------------------------

The different time scales
Delta-T
Delta-T 1972-present
Delta-T 1620-1972
Links to more information
Time signals by shortwave radio
World standard time zones

--------------------------------------------------------------------------------

The different time scales
TAI = International Atomic Time (Temps Atomique International = TAI) is
      defined as the weighted average of the time kept by about 200
      atomic clocks in over 50 national laboratories worldwide.
      TAI-UT1 was approximately 0 on 1958 Jan 1.


UTC = Coordinated Universal Time. Differs from TAI by an integral
      number of seconds. When needed, leap seconds are introduced in UTC
      to keep the difference between UTC and UT less than 0.9 s.
      UTC was introduced in 1972.


UT  = Universal time. Defined by the Earth's rotation, formerly determined
      by astronomical observations but today GPS satellites are used
      instead.  This time scale is slightly irregular.  There are several
      different definitions of UT, but the difference between them is always
      less than about 0.03 s.

UT0 = "raw", uncorrected UT as derived from meridian circle observations
      or from more modern methods involving GPS satellites.

UT1 = UT0 corrected for polar wandering - usually one means UT1 when
      saying UT.

UT2 = UT1 corrected for seasonal variations in the Earth's rotational
      speed, by adding
             + 0.022 * sin(2*pi*t) - 0.017 * cos(2*pi*t)
             - 0.007 * sin(4*pi*t) + 0.006 * cos(4*pi*t)
      seconds to UT1, where t is the fraction of the year (zero at 1 Jan).
      UT2 is nowadays considered obsolete.
      

ET  = Ephemeris Time. Was used 1960-1983, and was replaced by TDT and TDB
      in 1984.  For most purposes, ET up to 1983 Dec 31 and TDT from 1984
      Jan 1 can be regarded as a continuous time-scale.

TDT = Terrestial Dynamical Time.  Was used 1984-2000 as a time-scale of
      ephemerides from the Earth's surface.  TDT = TAI + 32.184.  Replaced
      ET (Ephemeris Time) in 1984, was replaced by TT (Terrestial Time)
      in 2001.

TDB = Barycentric Dynamical Time. Used as a time-scale of ephemerides
      referred to the barycentre of the solar system. Differs from TDT
      by at most a few milliseconds.
          TDB  =  TT  +  0.001 658s * sin(g)  +  0.000 014s * sin(2*g)
            g  =  357.53_d + 0.985 600 28_d * ( JD - 245 1545.0 )
          (higher order terms neglected; g = Earth's mean anomaly)

TT  = Terrestial Time. Originally used instead of TDT or TDB when the
      difference between them didn't matter.  Was defined in 1991 to be
      consistent with the SI second and the General Theory of Relativity.
      Replaced TDT in the ephemerides from 2001 and on.

TCG = Geocentric Coordinate Time. Defined in 1991 along with TT

TCB = Barycentric Coordinate Time. Defined in 1991 along with TT


delta-T =
      ET - UT   prior to 1984
      TDT - UT  1984 - 2000
      TT - UT   from 2001 and on

delta-UT =  UT - UTC

DUT = predicted value of delta-UT, rounded to 0.1s, given in some radio
      time signals.


GPS time = TAI - 19 seconds.  GPS time matched UTC from 1980-01-01
      to 1981-07-01.  No leap seconds are inserted into GPS time, thus
      GPS time is 13 seconds ahead of UTC on 2000-01-01.  The GPS epoch
      is 00:00 (midnight) UTC on 1980-01-06.
      The differences between GPS Time and International Atomic Time (TAI)
      and Terrestrial Time (TT), also know as Terrestrial Dynamical Time
      (TDT), are constant at the level of some tens of nanoseconds while
      the difference between GPS Time and UTC changes in increments of
      seconds each time a leap second is added to UTC time scale.

GPS week = a numbering of weeks starting at the GPS epoch 1980-01-06 00:00
      GPS time (which back then was equal to UTC).  Weeks are numbered from
      0 and up until 1023, then it "rolls back" to 0 and are again numbered
      from 0 and up, etc.  One GPS week rollover cycle is therefore 1024
      weeks = 7168 days = ca 19.62 years.  So far there's been one such GPS
      week number roll-over, on 1999-08-22 00:00 GPS time - a few older GPS
      receivers then ceased to show the correct date.


                                                 ET 1960-1983
                                                TDT 1984-2000
UTC 1972-  GPS 1980-    TAI 1958-               TT 2001-
----+---------+-------------+-------------------------+-----
    |         |             |                         |
    |<------ TAI-UTC ------>|<-----   TT-TAI    ----->|
    |         |             |      32.184s fixed      |
    |<GPS-UTC>|<- TAI-GPS ->|                         |
    |         |  19s fixed  |                         |
    |                                                 |
    <> delta-UT = UT1-UTC                             |
     | (max 0.9 sec)                                  |
-----+------------------------------------------------+-----
     |<-------------- delta-T = TT-UT1 -------------->|
    UT1 (UT)                                       TT/TDT/ET




Older time scales:

GMT = Greenwich Mean Time.  It's ambiguous, and is now used (although
      not in astronomy) in the sense of UTC in addition to the earlier
      sense of UT (in astronomical navigation, GMT still means UT).
      Prior to 1925, GMT was reckoned for astronomical purposes from
      Greenwich mean noon (12h UT) to avoid a date change in the middle
      of the night in Europe - a new GMT date then started 12 hours after
      the start of the corresponding civil date.  (Prior to 1805 the
      Royal Navy Day started 12 hour before local mean solar time, thus
      the Royal Navy Day was then approx. 24 hours ahead of GMT).

GCT = Greenwich Civil Time.  Used in the US from 1925 to mean the "new"
      GMT starting at Greenwich mean midnight, to distinguish it from
      the "old" GMT.  When UT was adopted, GCT fell out of use.

LMT = Local Mean Time.  The mean solar time at the local meridian.

LCT = Local Civil Time, the same as LMT.  Used in the US together with GCT.




--------------------------------------------------------------------------------

Delta-T
delta-T varies continuously, depending on the Earth's rotation.

UT1 is variable with respect to UTC. Leap seconds were introduced in UTC to keep delta-UT within +-0.9s.

TAI-UTC is always an integral number of seconds, and is varied when leap seconds are added (or removed, but that hasn't happened yet) at the end of every year, or every half-year, or every third month, in that order of priority.


--------------------------------------------------------------------------------

Table of time scales 1972-present, and some predictions
TT = TAI+32.184s ==> UT-UTC = TAI-UTC - (TT-UT) + 32.184s
Starting at    TAI-UTC   GPS-UTC   TT-UT1    UT1-UTC

1972-01-01       +10       -       +42.23    -0.05
1972-07-01       +11       -       +42.80    +0.38
1973-01-01       +12       -       +43.37    +0.81
1973-07-01        "        -       +43.93    +0.25
1974-01-01       +13       -       +44.49    +0.69
1974-07-01        "        -       +44.99    +0.19
1975-01-01       +14       -       +45.48    +0.70
1975-07-01        "        -       +45.97    +0.21
1976-01-01       +15       -       +46.46    +0.72
1976-07-01        "        -       +46.99    +0.19
1977-01-01       +16       -       +47.52    +0.66
1977-07-01        "        -       +48.03    +0.15
1978-01-01       +17       -       +48.53    +0.65
1978-07-01        "        -       +49.06    +0.12
1979-01-01       +18       -       +49.59    +0.59
1979-07-01        "        -       +50.07    +0.11
1980-01-01       +19       0       +50.54    +0.64
1980-07-01        "        "       +50.96    +0.22
1981-01-01        "        "       +51.38    -0.20
1981-07-01       +20       1       +51.78    +0.40
1982-01-01        "        "       +52.17    +0.01
1982-07-01       +21       2       +52.57    +0.61
1983-01-01        "        "       +52.96    +0.22
1983-07-01       +22       3       +53.38    +0.80
1984-01-01        "        "       +53.79    +0.39
1984-07-01        "        "       +54.07    +0.11
1985-01-01        "        "       +54.34    -0.16
1985-07-01       +23       4       +54.61    +0.57
1986-01-01        "        "       +54.87    +0.31
1986-07-01        "        "       +55.10    +0.08
1987-01-01        "        "       +55.32    -0.14
1987-07-01        "        "       +55.57    -0.39
1988-01-01       +24       5       +55.82    +0.36
1988-07-01        "        "       +56.06    +0.12
1989-01-01        "        "       +56.30    -0.12
1989-07-01        "        "       +56.58    -0.40
1990-01-01       +25       6       +56.86    +0.32
1990-07-01        "        "       +57.22    -0.04
1991-01-01       +26       7       +57.57    +0.61
1991-07-01        "        "       +57.94    +0.24
1992-01-01        "        "       +58.31    -0.13
1992-07-01       +27       8       +58.72    +0.46
1993-01-01        "        "       +59.12    +0.06
1993-07-01       +28       9       +59.55    +0.63
1994-01-01        "        "       +59.98    +0.20
1994-07-01       +29      10       +60.38    +0.80
1995-01-01        "        "       +60.78    +0.40
1995-07-01        "        "       +61.20    -0.02
1996-01-01       +30      11       +61.63    +0.55
1996-07-01        "        "       +61.96    +0.22
1997-01-01        "        "       +62.29    -0.11
1997-07-01       +31      12       +62.63    +0.55
1998-01-01        "        "       +62.97    +0.21
1998-07-01        "        "       +63.22    -0.04
1999-01-01       +32      13       +63.47    +0.71
1999-07-01        "        "       +63.66    +0.52
2000-01-01        "        "       +63.82    +0.36
2000-07-01        "        "       +63.98    +0.20
2001-01-01        "        "       +64.09    +0.09
2001-07-01        "        "       +64.20    -0.02
2002-01-01        "        "       +64.30    -0.12
2002-07-01        "        "       +64.41    -0.23
2003-01-01        "        "       +64.47    -0.29
2003-07-01        "        "       +64.55    -0.37
2004-01-01        "        "       +64.57    -0.39
2004-07-01        "        "       +64.65    -0.47
2005-01-01        "        "       +64.68    -0.50
2005-07-01        "        "       +64.80    -0.62
2006-01-01       +33      14       +64.85    +0.33
2006-07-01        "        "       +64.99    +0.19
2007-01-01        "        "       +65.15    +0.03
2007-07-01        "        "       +65.34    -0.16
2008-01-01        "        "       +65.45    -0.27
2008-07-01        "        "       +65.63    -0.45
2009-01-01       +34      14       +65.70    +0.48 (pred)
2010-01-01        "        "       +66.5     -0.3  (pred)
2011-01-01        ?        ?       +67.1
2012-01-01        ?        ?       +68

(last updated 2009-01-01)


--------------------------------------------------------------------------------

Delta-T 1620-1972
delta-T = ET - UT for the years 1620 - 1972
         ET-UT, s

Year      +0.0     +1.0    +2.0     +3.0     +4.0
----------------------------------------------------
1620      +124     +119    +115     +110     +106
1625      +102      +98     +95      +91      +88
1630       +85      +82     +79      +77      +74
1635       +72      +70     +67      +65      +63
1640       +62      +60     +58      +57      +55
1645       +54      +53     +51      +50      +49
1650       +48      +47     +46      +45      +44
1655       +43      +42     +41      +40      +38
1660       +37      +36     +35      +34      +33
1665       +32      +31     +30      +28      +27
1670       +26      +25     +24      +23      +22
1675       +21      +20     +19      +18      +17
1680       +16      +15     +14      +14      +13
1685       +12      +12     +11      +11      +10
1690       +10       +9      +9       +9       +9
1695        +9       +9      +9       +9       +9
1700       +10       +9      +9       +9       +9
1705        +9       +9      +9      +10      +10
1710       +10      +10     +10      +10      +10
1715       +10      +10     +11      +11      +11
1720       +11      +11     +11      +11      +11
1725       +11      +11     +11      +11      +11
1730       +11      +11     +11      +11      +12
1735       +12      +12     +12      +12      +12
1740       +12      +12     +12      +12      +13
1745       +13      +13     +13      +13      +13
1750       +13      +14     +14      +14      +14
1755       +14      +14     +14      +15      +15
1760       +15      +15     +15      +15      +15
1765       +16      +16     +16      +16      +16
1770       +16      +16     +16      +16      +16
1775       +17      +17     +17      +17      +17
1780       +17      +17     +17      +17      +17
1785       +17      +17     +17      +17      +17
1790       +17      +17     +16      +16      +16
1795       +16      +15     +15      +14      +14
1800       +13.7    +13.4   +13.1    +12.9    +12.7
1805       +12.6    +12.5   +12.5    +12.5    +12.5
1810       +12.5    +12.5   +12.5    +12.5    +12.5
1815       +12.5    +12.5   +12.4    +12.3    +12.2
1820       +12.0    +11.7   +11.4    +11.1    +10.6
1825       +10.2     +9.6    +9.1     +8.6     +8.0
1830        +7.5     +7.0    +6.6     +6.3     +6.0
1835        +5.8     +5.7    +5.6     +5.6     +5.6
1840        +5.7     +5.8    +5.9     +6.1     +6.2
1845        +6.3     +6.5    +6.6     +6.8     +6.9
1850        +7.1     +7.2    +7.3     +7.4     +7.5
1855        +7.6     +7.7    +7.7     +7.8     +7.8
1860        +7.88    +7.82   +7.54    +6.97    +6.40
1865        +6.02    +5.41   +4.10    +2.92    +1.81
1870        +1.61    +0.10   -1.02    -1.28    -2.69
1875        -3.24    -3.64   -4.54    -4.71    -5.11
1880        -5.40    -5.42   -5.20    -5.46    -5.46
1885        -5.79    -5.63   -5.64    -5.80    -5.66
1890        -5.87    -6.01   -6.19    -6.64    -6.44
1895        -6.47    -6.09   -5.76    -4.66    -3.74
1900        -2.72    -1.54   -0.02    +1.24    +2.64
1905        +3.86    +5.37   +6.14    +7.75    +9.13
1910       +10.46   +11.53   +13.36   +14.65   +16.01
1915       +17.20   +18.24   +19.06   +20.25   +20.95
1920       +21.16   +22.25   +22.41   +23.03   +23.49
1925       +23.62   +23.86   +24.49   +24.34   +24.08
1930       +24.02   +24.00   +23.87   +23.95   +23.86
1935       +23.93   +23.73   +23.92   +23.96   +24.02
1940       +24.33   +24.83   +25.30   +25.70   +26.24
1945       +26.77   +27.28   +27.78   +28.25   +28.71
1950       +29.15   +29.57   +29.97   +30.36   +30.72
1955       +31.07   +31.35   +31.68   +32.18   +32.68
1960       +33.15   +33.59   +34.00   +34.47   +35.03
1965       +35.73   +36.54   +37.43   +38.29   +39.20
1970       +40.18   +41.17   +42.23


--------------------------------------------------------------------------------

Links to more information
More information can be obtained at:

Wikipedia: http://en.wikipedia.org/wiki/International_Atomic_Time

Steve Allen's detailed history of the different time scales: http://www.ucolick.org/~sla/leapsecs/timescales.html

BIPM - Bureau International des Poids et Mesures: http://www.bipm.fr/en/scientific/tai/

USNO Time Service Department: http://tycho.usno.navy.mil/

IERS - International Earth Rotation and Reference Systems Service: http://www.iers.org/iers/earth/glossary/tai.html

Past leap seconds info:
ftp://maia.usno.navy.mil/ser7/tai-utc.dat

UT1-UTC data: ftp://maia.usno.navy.mil/ser7/
Daily data since 1972, and predictions -- large! ftp://maia.usno.navy.mil/ser7/finals.all
Explanation to the previous file ftp://maia.usno.navy.mil/ser7/readme.finals

Rapid service and prediction of Earth orientation parameters: http://maia.usno.navy.mil/

USNO Earth Orientation Service: http://maia.usno.navy.mil/eo/eo_prod.html

IERS - International Earth Rotation Service: http://hpiers.obspm.fr/
IERS Leap Seconds Bulletins: ftp://hpiers.obspm.fr/iers/bul/bulc/ ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat
Info on GPS time:
http://tycho.usno.navy.mil/gpstt.html
http://tycho.usno.navy.mil/gps_datafiles.html


--------------------------------------------------------------------------------

Time signals by shortwave radio
Europe:
RWM (Moscow)    CW   4996, 9996, 14996 kHz

North America:
WWV (USA)       AM   2500, 5000, 10000, 15000, 20000  kHz
CHU (Canada)    AM   3330, 7335, 14670  kHz

Worldwide list - Another list - Time signals (Wikipedia)
--------------------------------------------------------------------------------

World standard time zones

In October 1884, an International Time Conference adopted the Greenwich Meridian as the prime meridian or zero degree point and divided the world into 24 equal divisions of 15 degrees each.

Here is a table of the current International Time Zones:
http://en.wikipedia.org/wiki/Time_zone
Map of time zones

出0入0汤圆

 楼主| 发表于 2010-7-16 14:20:17 | 显示全部楼层
上传非常实用的天宝GPS模块工具开发软件,
连接GPS模块,设置串口后,用谷歌地球(需要上网),可以定位当前位置。

点击此处下载 ourdev_568182CTWIWP.zip(文件大小:1.94M) (原文件名:TrimbleMon_V1-04-00.zip)

出0入0汤圆

发表于 2010-10-15 22:50:14 | 显示全部楼层
这个帖子不能不顶

出0入0汤圆

发表于 2010-10-16 08:29:07 | 显示全部楼层
顶起,等发工资再买GPS...

出0入0汤圆

发表于 2010-10-18 20:09:35 | 显示全部楼层
MARK,好贴,好好看看

出0入0汤圆

发表于 2010-12-28 15:50:37 | 显示全部楼层
lz辛苦了

出0入0汤圆

发表于 2010-12-30 13:51:00 | 显示全部楼层
期待啊,我一直想用GPS做一个准确的时钟,到现在我还是不明白什么授时GPS,难道我买的C370的时间不是准确的吗,还有就是如何把UTC转化成北京时间哪~

出0入0汤圆

发表于 2011-1-10 19:10:02 | 显示全部楼层
收下了!!

出0入0汤圆

发表于 2011-3-9 15:05:00 | 显示全部楼层
mark

出0入0汤圆

发表于 2011-3-15 12:59:51 | 显示全部楼层
好贴~顶

出0入0汤圆

发表于 2011-3-15 13:05:24 | 显示全部楼层
学习

出0入0汤圆

发表于 2011-5-17 09:02:14 | 显示全部楼层
好贴。

出0入0汤圆

发表于 2011-5-28 21:15:06 | 显示全部楼层

出0入0汤圆

发表于 2011-9-22 11:34:49 | 显示全部楼层
用51做,如何解决冷热启动

出0入0汤圆

发表于 2011-9-22 16:09:39 | 显示全部楼层
先书签了,等着实验这段的可行性

出0入0汤圆

 楼主| 发表于 2011-9-23 13:35:34 | 显示全部楼层
回复:
------------------
【15楼】 wdc014
用51做,如何解决冷热启动  
------------------

好像GPS分3种启动方式:
1、冷启动方式,就是GPS模块主电源及数据备份电源全部断电后,再开机启动
2、温启动方式,就是GPS模块主电源及数据备份电源全部断电后,开机后,导入了以前的轨道上GPS星历数据后启动
3、热启动方式,就是GPS模块数据备份电源不断电,还保留几小时前的轨道上GPS星历数据,主电源断电后,再开机启动

出0入0汤圆

发表于 2011-12-19 20:11:58 | 显示全部楼层
求教育 QQ82065301 急需帮助

出0入0汤圆

发表于 2011-12-19 20:14:46 | 显示全部楼层
顶啊顶
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-5-17 02:35

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表