CN109004937A - A kind of high-precision B code generation method and module - Google Patents

A kind of high-precision B code generation method and module Download PDF

Info

Publication number
CN109004937A
CN109004937A CN201810768067.8A CN201810768067A CN109004937A CN 109004937 A CN109004937 A CN 109004937A CN 201810768067 A CN201810768067 A CN 201810768067A CN 109004937 A CN109004937 A CN 109004937A
Authority
CN
China
Prior art keywords
precision
time
external standard
standard time
timing chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810768067.8A
Other languages
Chinese (zh)
Inventor
李希伦
陈治高
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sdi Science & Technology Co Ltd
Original Assignee
Beijing Sdi Science & Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sdi Science & Technology Co Ltd filed Critical Beijing Sdi Science & Technology Co Ltd
Priority to CN201810768067.8A priority Critical patent/CN109004937A/en
Publication of CN109004937A publication Critical patent/CN109004937A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M5/00Conversion of the form of the representation of individual digits
    • H03M5/02Conversion to or from representation by pulses
    • H03M5/04Conversion to or from representation by pulses the pulses having two levels

Abstract

The present invention relates to a kind of high-precision B code generation methods, including base inputs when (1), and external standard time is received in the form of UART and PPS;(2) precarry is handled, and establishes a RTC timing chain, after receiving the external standard time transmitted in the form of PPS, pre-add 1S obtains pretreatment time to RTC timing chain forward on the basis of external standard time;(3) IRIG-B DC is encoded, and after obtaining external standard time in the form of UART, is calibrated to RTC timing chain, and RTC timing chain calculates which day that the current time is whole year, i.e. Day field in IRIG-B;(4) after reaching pretreatment time, high-precision B code is exported outward in the form of low and high level.The invention also discloses a kind of high-precision B code generation module, including when base input module, precarry processing module, IRIG-B DC coding module and output module.

Description

A kind of high-precision B code generation method and module
Technical field
The invention belongs to modern communications and navigation field, and in particular to a kind of high-precision B code generation method and module.
Background technique
With the development that current electronic technology is maked rapid progress, time synchronization has obtained more and more important application.IRIG-B Code is used as a kind of serial time code, is a kind of mode of important time synchronization transmission, with its practical superior function outstanding, at For the standard pattern of timing equipment first choice, it is widely applied to the important industry such as telecommunications, electric power, military affairs or department.
Traditional B code coder usually encodes current time when PPS and serial time information arrive, this is resulted in B code has a very big delay relative to PPS, and synchronousness is poor.
Summary of the invention
The purpose of the present invention is aiming at the shortcomings in the prior art, providing a kind of high-precision B code generation method and module, protect Demonstrate,prove the real-time of time data.
To achieve the above object, the invention discloses following technical solutions:
A kind of high-precision B code generation method, includes the following steps:
(1) base inputs when
External standard time is received in the form of UART and PPS;
(2) precarry is handled
A RTC timing chain is established, after receiving the external standard time transmitted in the form of PPS, RTC timing chain exists Pre-add 1S obtains pretreatment time forward on the basis of external standard time;
(3) IRIG-B DC is encoded
After obtaining external standard time in the form of UART, RTC timing chain is calibrated, then RTC timing chain is also wanted Which that the current time is whole year is calculated according to the current time (obtaining external standard time i.e. in the form of UART) It, i.e. Day field in IRIG-B, subsequently into step (4)
(4) after reaching pretreatment time, high-precision B code is exported outward in the form of low and high level.
Further, receive what external standard time was provided by external equipment in the form of UART and PPS in step (1) System time-base determines.
Further, each code element in high-precision B code corresponds to 10ms, so being encoded by the way of following:
One 1ms timer MML is set in the processor, rising edge as its reference point, while construct a logic to It measuring CMP (BBBBBBBBBB), wherein B represents 0 or 1, determines coding output according to MML and CMP, if output is 0, for 000000011, corresponding 2ms;It is 0000011111 if output is 1, corresponding 5ms;Index pulse is 0011111111, corresponding 8ms。
Further, in precarry processing when pre-add 1S, to distinguish that leap year, the moon be big, the moon small influence to Day field.
A kind of high-precision B code generation module, comprising:
When base input module, in the form of UART and PPS receive external standard time;
Precarry processing module establishes a RTC timing chain, when receiving the external perimysium reference transmitted in the form of PPS Between after, pre-add 1S obtains pretreatment time to RTC timing chain forward on the basis of external standard time;
IRIG-B DC coding module calibrates RTC timing chain after obtaining external standard time in the form of UART, Then it is current will also to calculate this according to current time (obtaining external standard time i.e. in the form of UART) for RTC timing chain Time is which annual day, i.e. Day field in IRIG-B, subsequently into step (4)
Output module exports high-precision B code after reaching pretreatment time outward in the form of low and high level.
Further, it is true that the system time-base that external standard time is provided by external equipment is received in the form of UART and PPS It is fixed.
Further, each code element in high-precision B code corresponds to 10ms, so being encoded by the way of following:
One 1ms timer MML is set in the processor, rising edge as its reference point, while construct a logic to It measuring CMP (BBBBBBBBBB), wherein B represents 0 or 1, determines coding output according to MML and CMP, if output is 0, for 000000011, corresponding 2ms;It is 0000011111 if output is 1, corresponding 5ms;Index pulse is 0011111111, corresponding 8ms。
Further, in precarry processing when pre-add 1S, to distinguish that leap year, the moon be big, the moon small influence to Day field.
A kind of high-precision B code generation method disclosed by the invention and module, have the advantages that
The present invention uses pretreated mode, and 1s can handle out data before current time, guarantees when 1PPS is reached, Data are sent with the smallest delay, ensure that the real-time of time data.
Detailed description of the invention
Fig. 1 is a kind of schematic diagram for applying high-precision B code generation module disclosed by the invention.
Specific embodiment
The technical scheme in the embodiments of the invention will be clearly and completely described below, it is clear that described implementation Example is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is common Technical staff's every other embodiment obtained without making creative work belongs to the model that the present invention protects It encloses.
Fig. 1 is a kind of schematic diagram for applying high-precision B code generation module disclosed by the invention.As shown in Figure 1, a kind of high-precision B code generation method is spent, is included the following steps:
(1) base inputs when
External standard time is received in the form of UART and PPS;
(2) precarry is handled
A RTC timing chain is established, after receiving the external standard time transmitted in the form of PPS, RTC timing chain exists Pre-add 1S obtains pretreatment time forward on the basis of external standard time;
(3) IRIG-B DC is encoded
After obtaining external standard time in the form of UART, RTC timing chain is calibrated, then RTC timing chain is also wanted Which that the current time is whole year is calculated according to the current time (obtaining external standard time i.e. in the form of UART) It, i.e. Day field in IRIG-B, subsequently into step (4)
(4) after reaching pretreatment time, high-precision B code is exported outward in the form of low and high level.
Further, receive what external standard time was provided by external equipment in the form of UART and PPS in step (1) System time-base determines.
Further, each code element in high-precision B code corresponds to 10ms, so being encoded by the way of following:
One 1ms timer MML is set in the processor, rising edge as its reference point, while construct a logic to It measuring CMP (BBBBBBBBBB), wherein B represents 0 or 1, determines coding output according to MML and CMP, if output is 0, for 000000011, corresponding 2ms;It is 0000011111 if output is 1, corresponding 5ms;Index pulse is 0011111111, corresponding 8ms。
Further, in precarry processing when pre-add 1S, to distinguish that leap year, the moon be big, the moon small influence to Day field.
The invention also discloses a kind of high-precision B code generation modules, comprising:
When base input module, in the form of UART and PPS receive external standard time;
Precarry processing module establishes a RTC timing chain, when receiving the external perimysium reference transmitted in the form of PPS Between after, pre-add 1S obtains pretreatment time to RTC timing chain forward on the basis of external standard time;
IRIG-B DC coding module calibrates RTC timing chain after obtaining external standard time in the form of UART, Then it is current will also to calculate this according to current time (obtaining external standard time i.e. in the form of UART) for RTC timing chain Time is which annual day, i.e. Day field in IRIG-B, subsequently into step (4)
Output module exports high-precision B code after reaching pretreatment time outward in the form of low and high level.
Further, it is true that the system time-base that external standard time is provided by external equipment is received in the form of UART and PPS It is fixed.
Further, each code element in high-precision B code corresponds to 10ms, so being encoded by the way of following:
One 1ms timer MML is set in the processor, rising edge as its reference point, while construct a logic to It measuring CMP (BBBBBBBBBB), wherein B represents 0 or 1, determines coding output according to MML and CMP, if output is 0, for 000000011, corresponding 2ms;It is 0000011111 if output is 1, corresponding 5ms;Index pulse is 0011111111, corresponding 8ms。
Further, in precarry processing when pre-add 1S, to distinguish that leap year, the moon be big, the moon small influence to Day field.
The above is only a preferred embodiment of the present invention, rather than its limitations;Although should be pointed out that referring to above-mentioned each Embodiment describes the invention in detail, those skilled in the art should understand that, it still can be to above-mentioned each Technical solution documented by embodiment is modified, or equivalent substitution of some or all of the technical features;And this A little modifications and replacement, do not make the essence of corresponding technical solution depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (6)

1. a kind of high-precision B code generation method, which comprises the steps of:
(1) base inputs when
External standard time is received in the form of UART and PPS;
(2) precarry is handled
A RTC timing chain is established, after receiving the external standard time transmitted in the form of PPS, RTC timing chain is in outside Pre-add 1S obtains pretreatment time forward on the basis of standard time;
(3) IRIG-B DC is encoded
After obtaining external standard time in the form of UART, RTC timing chain is calibrated, then RTC timing chain will also basis The current time calculates which day that the current time is whole year, i.e. Day field in IRIG-B, subsequently into step (4)
(4) after reaching pretreatment time, high-precision B code is exported outward in the form of low and high level.
2. a kind of high-precision B code generation method according to claim 1, which is characterized in that in step (1) with UART and The form of PPS receives external standard time and is determined by the system time-base that external equipment provides.
3. a kind of high-precision B code generation method according to claim 1, which is characterized in that each code in high-precision B code The corresponding 10ms of member, so being encoded by the way of following:
One 1ms timer MML is set in the processor, and rising edge constructs a vector logic as its reference point CMP, vector logic CMP use BBBBBBBBBB form, wherein and B represents 0 or 1, determines coding output according to MML and CMP, if Output is 0, then is 000000011, corresponding 2ms;It is 0000011111 if output is 1, corresponding 5ms;Index pulse is 0011111111, corresponding 8ms.
4. a kind of high-precision B code generation module characterized by comprising
When base input module, in the form of UART and PPS receive external standard time;
Precarry processing module establishes a RTC timing chain, after receiving the external standard time transmitted in the form of PPS, Pre-add 1S obtains pretreatment time to RTC timing chain forward on the basis of external standard time;
IRIG-B DC coding module is calibrated RTC timing chain, then after obtaining external standard time in the form of UART RTC timing chain will also calculate the current time according to the current time (obtaining external standard time i.e. in the form of UART) For which annual day, i.e. Day field in IRIG-B, subsequently into step (4)
Output module exports high-precision B code after reaching pretreatment time outward in the form of low and high level.
5. a kind of high-precision B code generation module according to claim 4, which is characterized in that connect in the form of UART and PPS External standard time is received to be determined by the system time-base that external equipment provides.
6. a kind of high-precision B code generation module according to claim 4, which is characterized in that each code in high-precision B code The corresponding 10ms of member, so being encoded by the way of following:
One 1ms timer MML is set in the processor, and rising edge constructs a vector logic as its reference point CMP, vector logic CMP use BBBBBBBBBB form, wherein and B represents 0 or 1, determines coding output according to MML and CMP, if Output is 0, then is 000000011, corresponding 2ms;It is 0000011111 if output is 1, corresponding 5ms;Index pulse is 0011111111, corresponding 8ms.
CN201810768067.8A 2018-07-13 2018-07-13 A kind of high-precision B code generation method and module Pending CN109004937A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810768067.8A CN109004937A (en) 2018-07-13 2018-07-13 A kind of high-precision B code generation method and module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810768067.8A CN109004937A (en) 2018-07-13 2018-07-13 A kind of high-precision B code generation method and module

Publications (1)

Publication Number Publication Date
CN109004937A true CN109004937A (en) 2018-12-14

Family

ID=64599653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810768067.8A Pending CN109004937A (en) 2018-07-13 2018-07-13 A kind of high-precision B code generation method and module

Country Status (1)

Country Link
CN (1) CN109004937A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114006620A (en) * 2021-10-27 2022-02-01 北斗天汇(北京)科技有限公司 IRIG alternating-current B code decoding method and system with automatic adjustment function

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011012158A1 (en) * 2009-07-28 2011-02-03 Ecole Polytechnique Federale De Lausanne Encoding and decoding of information
CN103997331A (en) * 2014-06-11 2014-08-20 四川九洲电器集团有限责任公司 High-precision DC code encoding method and system based on FPGA
CN105763199A (en) * 2016-04-13 2016-07-13 云南电网有限责任公司电力科学研究院 FPGA-based IRIG-B(DC) fast decoding method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011012158A1 (en) * 2009-07-28 2011-02-03 Ecole Polytechnique Federale De Lausanne Encoding and decoding of information
CN103997331A (en) * 2014-06-11 2014-08-20 四川九洲电器集团有限责任公司 High-precision DC code encoding method and system based on FPGA
CN105763199A (en) * 2016-04-13 2016-07-13 云南电网有限责任公司电力科学研究院 FPGA-based IRIG-B(DC) fast decoding method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
庞吉耀: "基于FPGA的IRIG-B编码器实现", 《现代电子技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114006620A (en) * 2021-10-27 2022-02-01 北斗天汇(北京)科技有限公司 IRIG alternating-current B code decoding method and system with automatic adjustment function
CN114006620B (en) * 2021-10-27 2023-01-17 北斗天汇(北京)科技有限公司 IRIG alternating-current B code decoding method and system with automatic adjustment function

Similar Documents

Publication Publication Date Title
MX2019015482A (en) Method and device for encoding polar code.
CN101398666A (en) Big dipper satellite synchronizing clock time signal B code generating method and apparatus
CN104639309A (en) IRIG-B (Inter-range Instrumentation Group-B)-based automatic time delay compensation method and system thereof
CN109004937A (en) A kind of high-precision B code generation method and module
CN101043253A (en) Process for obtaining high-precision time
CN105553600A (en) IRIG-B direct current code coding and decoding device and coding and decoding method thereof
JP2017523664A (en) Phase deviation compensation method and apparatus
CN112861548A (en) Natural language generation and model training method, device, equipment and storage medium
CN102510327A (en) Method and device for improving synchronous precision of long-range two-way time comparison modulator-demodulator
US11188115B2 (en) Sequence signal generator and sequence signal generation method
CN103838183A (en) Numerical control system and output control method thereof
CN201674483U (en) IRIG_B code decoding interface circuit
CN102441239B (en) Digital power supply synchronization system and method applied to cancer treatment for ion accelerator
CN111193514A (en) High-synchronization-precision IRIG-B encoder
CN104199277A (en) Electronic clock correcting method based on audio transmission
CN101872156A (en) System and method for timing electronic device
CN108631752B (en) Shaping filter and shaping method thereof
CN116506058A (en) Time service system, method and application based on all-optical network and Kalman filtering correction
CN202231606U (en) Digital power supply synchronous system for ion accelerator for cancer treatment
CN101055479B (en) System and method for realizing data update of non-clock-control register
WO2016134632A1 (en) Data processing system
RU2638732C1 (en) Method of information transmission
CN105548995A (en) Method for improving distance measurement precision of responder
CN201557123U (en) Device for converting network time signal into direct current time code
CN107968647B (en) Clock recovery method and system in frequency shift keying regulation system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20181214

RJ01 Rejection of invention patent application after publication