A fast switching method of second pulse

By using rising edge detection and counter to determine the phase state in the second pulse switching method, the rapid switching of the second pulse signal is achieved, solving the problem of long switching time in the prior art, and improving the signal output quality and user experience.

CN115037288BActive Publication Date: 2025-04-25ZHEJIANG SAISI ELECTRONICAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210313668.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-04-25
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

The switching time of the second pulse switching method in the prior art is long, resulting in a significant sense of pause in the signal output, affecting the signal output and user experience of the device.

Method used

The rising edge detection method is used to detect the PPS of A and B. When it is detected that both PPSs are high or one of them is high, the phase state of the two PPSs is quickly judged by setting a counter to achieve rapid switching, with the switching time less than 1 second.

Benefits of technology

It realizes rapid switching of second pulse signals, shortening the switching time to less than 1 second, and is suitable for PPS signal switching control of various phase relationships, improving the signal output quality and user experience of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115037288B_ABST
    Figure CN115037288B_ABST
Patent Text Reader

Abstract

The present invention discloses a fast switching method of second pulses. Given a working clock, a rising edge detection method is used to detect the rising edge of the PPS of the A and B channels. When it is detected that the PPS of the A and B channels are both at a high level, one of the channels is selected as a reference signal and switched to this channel. When it is continuously detected that the PPS of the A and B channels are both at a low level, there is no signal source input, and no switching is required. By setting a counter, the phase state of the two PPS channels is quickly determined according to the counter value, and fast switching is achieved, and the switching time can achieve an interval of less than 1 second. In addition, the present invention is also applicable to the switching control of PPS signals with various different phase relationships, including the switching of two PPS signals with the same phase, the switching of two PPS signals with different phases and partially overlapping high levels, and the switching of two PPS signals with different phases and completely non-overlapping high levels, which solves the technical problem of long switching time of the second pulse switching method in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of time-frequency technology and relates to a switching method, in particular to a quick switching method of second pulses. Background Art

[0002] PPS (Pulse Per Second) is a commonly used reference signal in the field of time-frequency technology. The most obvious rule of PPS is that it repeats regularly according to integer seconds. That is to say, after detecting the rising edge of a PPS, it is necessary to wait for a full second before repeatedly detecting the rising edge of the next PPS. When both PPS signals are present and it is necessary to switch to another signal, the traditional method is to first detect the loss of the PPS and then perform the switching action. This method is completely feasible. However, it takes more than one second from detecting the entire PPS to performing the switching action. The switching time is relatively long. Therefore, when measuring the output signal at the output end of the device, there will be a more obvious signal pause, which will affect the signal output of the device and greatly reduce the user experience. Summary of the invention

[0003] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a fast switching method of second pulses to solve the technical problem of long switching time of the second pulse switching method in the prior art.

[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions to achieve the above problems:

[0005] Given a working clock, the rising edge detection method is used to detect the rising edge of the PPS of channel A and channel B;

[0006] When it is detected that the PPS of both channel A and channel B are high, one of them is selected as the reference signal and switched to this channel;

[0007] When it is continuously detected that the PPS of channels A and B are both at low level, there is no signal source input, and no switching is required;

[0008] When it is detected that the PPS of channels A and B are not high at the same time and channel A is detected to be high first, it is determined whether the count value of the counter is less than a specified value, and the specified value is the working clock frequency minus one; if it is less than the specified value, both channels A and B have reference signals, and one of them is selected as the reference signal and switched to this channel; if it is greater than or equal to the specified value, only channel A has a reference signal, and channel A is selected as the reference signal and switched to channel A;

[0009] When it is detected that the PPS of channels A and B are not high at the same time and channel B is detected as high first, it is determined whether the count value of the counter is less than the specified value, and the specified value is the working clock frequency minus one; if it is less than the specified value, both channels A and B have reference signals, and one of them is selected as the reference signal and switched to this channel; if it is greater than or equal to the specified value, only channel B has a reference signal, and channel B is selected as the reference signal and switched to channel B.

[0010] The present invention also includes the following technical features:

[0011] The rising edge detection method specifically comprises the following steps:

[0012] S1, synchronously delay the PPS signal by one beat and two beats respectively, to obtain a signal delayed by one clock cycle and a signal delayed by two clock cycles relative to the original PPS signal respectively;

[0013] S2, inverts the signal delayed by two clock cycles, and performs a logical AND operation with the signal delayed by one clock cycle to obtain a new signal;

[0014] S3, detecting the obtained new signal, if the new signal is at a high level, a rising edge is detected, if the new signal is not at a high level, no rising edge is detected.

[0015] The working method of the counter specifically comprises the following steps:

[0016] Q1, detect the two PPS signals according to the rising edge detection method, and mark the detection results of the two PPS signals;

[0017] Q2, the result of the OR operation of the two detection results is used as the reset flag of the counter, and the level of the reset flag is determined;

[0018] Q3, if the clear flag is high, the initial value of the counter is cleared first and then starts counting, until the count value reaches the set maximum value and the counter stops counting; if the clear flag is low, the counter cannot start counting and is in the stop counting state;

[0019] Q4, when the counter stops counting, it enters Q1 and continuously detects the rising edge signals of the two PPSs.

[0020] Compared with the prior art, the present invention has the following beneficial technical effects:

[0021] The method of the present invention sets a counter and quickly determines the phase state of two PPSs according to the counter value to achieve fast switching, and the switching time can achieve an interval of less than 1 second. In addition, the present invention is also applicable to the switching control of PPS signals with various different phase relationships, including the switching of two PPS signals with the same phase, the switching of two PPS signals with different phases and partially overlapping high levels, and the switching of two PPS signals with different phases and completely non-overlapping high levels, thereby solving the technical problem of long switching time of the second pulse switching method in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flow chart of the method of the present invention;

[0023] Figure 2 This is a flow chart of signal rising edge detection in the present invention;

[0024] Figure 3 This is the working principle diagram of the counter;

[0025] Figure 4 This is a two-way PPS diagram in which the A-way leads the B-way and the pulses do not overlap at all;

[0026] Figure 5 The two-way PPS diagram in which the B-way leads the A-way and the pulses do not overlap at all in the present invention;

[0027] Figure 6 The PPS diagram of two paths in which path A leads path B and the pulses partially overlap in the present invention;

[0028] Figure 7 The two-way PPS diagram in which the B-way leads the A-way and the pulses partially overlap in the present invention;

[0029] Figure 8 This is a two-channel PPS diagram in which channel A is detected first and only channel A has a signal in the present invention.

[0030] The specific contents of the present invention are further explained in detail below in conjunction with embodiments. DETAILED DESCRIPTION

[0031] It should be noted that, unless otherwise specified, all components in the present invention are components known in the art.

[0032] Specific embodiments of the present invention are given below. It should be noted that the present invention is not limited to the following specific embodiments, and all equivalent changes made on the basis of the technical solution of this application fall within the protection scope of the present invention.

[0033] The present invention provides a method for fast switching of second pulses, such as Figure 1 As shown, the method comprises the following steps:

[0034] The rising edge detection method is used to detect the rising edge of the PPS of the A and B channels;

[0035] When it is detected that the PPS of both channel A and channel B are high, one of them is selected as the reference signal and switched to this channel;

[0036] When it is continuously detected that the PPS of channels A and B are both at low level, there is no signal source input, and no switching is required;

[0037] When it is detected that the PPS of channels A and B are not high at the same time and channel A is detected to be high first, it is determined whether the count value of the counter is less than the specified value, which is the working clock frequency minus one; if it is less than the specified value, both channels A and B have reference signals, and one of them is selected as the reference signal and switched to this channel; if it is greater than or equal to the specified value, only channel A has a reference signal, and channel A is selected as the reference signal and switched to channel A;

[0038] When it is detected that the PPS of channels A and B are not high at the same time and channel B is detected as high first, it is determined whether the count value of the counter is less than the specified value, which is the working clock frequency minus one; if it is less than the specified value, both channels A and B have reference signals, and one of them is selected as the reference signal and switched to this channel; if it is greater than or equal to the specified value, only channel B has a reference signal, and channel B is selected as the reference signal and switched to channel B.

[0039] In the above technical solution, a rising edge detection method is used to detect the rising edge of the PPS of A and B; when it is detected that the PPS of A and B are both high, one of them is selected as a reference signal and switched to this one, and the switching speed is fast; when it is continuously detected that the PPS of A and B are both low at the same time, there is no signal source input, and no switching is required; when it is detected that the PPS of A and B are not high at the same time and one is detected to be high first, a counter is set to quickly judge the phase state of the two PPS according to the counter value to achieve fast switching, and the switching time can achieve an interval of less than 1 second. In addition, the technical solution is also applicable to the switching control of PPS signals with various different phase relationships, including the switching of two PPS signals with the same phase, the switching of two PPS signals with different phases and partially overlapping high levels, and the switching of two PPS signals with different phases and completely non-overlapping high levels, which solves the technical problem of long switching time of the second pulse switching method in the prior art.

[0040] Specifically, Figure 2 As shown, the rising edge detection method specifically includes the following steps:

[0041] S1, synchronously delay the PPS signal by one beat and two beats respectively, to obtain a signal delayed by one clock cycle and a signal delayed by two clock cycles relative to the original PPS signal respectively;

[0042] S2, inverts the signal delayed by two clock cycles, and performs a logical AND operation with the signal delayed by one clock cycle to obtain a new signal;

[0043] S3, detecting the obtained new signal, if the new signal is at a high level, a rising edge is detected, if the new signal is not at a high level, no rising edge is detected.

[0044] Specifically, Figure 3 As shown, the working method of the counter specifically includes the following steps:

[0045] Q1, detect the two PPS signals according to the rising edge detection method, and mark the detection results of the two PPS signals;

[0046] Q2, the result of the OR operation of the two detection results is used as the reset flag of the counter, and the level of the reset flag is determined;

[0047] Q3, if the clear flag is high, the initial value of the counter is cleared first and then starts counting, until the count value reaches the set maximum value and the counter stops counting; if the clear flag is low, the counter cannot start counting and is in the stop counting state;

[0048] Q4, when the counter stops counting, it enters Q1 and continuously detects the rising edge signals of the two PPSs.

[0049] Actual test example:

[0050] Using the above technical solution, taking the 200M working clock as an example, if the count value is set to count for one second, the count value should be the working clock frequency minus one. For the 200M clock, the count value is the decimal value of 199999999. If it is detected that the two PPSs are not high at the same time, such as Figures 4 to 8 As shown, Figure 4 and Figure 5 This is the case where the PPS pulses of channel A and channel B do not overlap at all. Figure 4In the figure, channel A leads channel B by time t. When the rising edge detection is performed on the PPS signals of channels A and B respectively, the rising edge can be detected. Therefore, there will be two reset marks when the counter is working. The rising edges generated by channels A and B will generate two reset operations on the counter. The time difference t between the rising edge of channel A PPS and the rising edge of channel B PPS in the dotted part is obviously less than one second. After the rising edge comes, the count value of the counter will be reset, which means that the count value must be less than 199999999. From this counting result, it can be judged that channels A and B have PPS signals. At this time, the time to switch to one of the channels must be less than one second. For channel B leading channel A by time t Figure 5 situations, treatment methods and Figure 4 Exactly the same, through the counting result, it can be judged that both channel A and channel B have PPS signals, and the time to switch to one of them is less than one second.

[0051] Figure 6 and Figure 7 The A-channel PPS and B-channel PPS pulses partially overlap, where: Figure 6 It first detects that the A channel is at a high level. Figure 7 First, it detects that the B channel is at a high level, and then continues to judge whether the count value of the counter is less than the specified value; taking 200M as the working clock, according to the above analysis, the count value must be less than 199999999, so both A and B channels have reference signals, select one of them as the reference signal and switch to this channel.

[0052] Figure 8 This is a two-channel PPS diagram in which channel A is detected first and only channel A has a signal in the present invention. That is, if channel A is detected to be high level first and the count value is greater than or equal to the specified value, then only channel A has a reference signal, and channel A is selected as the reference signal and switched to channel A.

Claims

1. A method for rapid switching of second pulses, characterized in that: The method comprises the following steps: Given a working clock, the rising edge detection method is used to detect the rising edge of the PPS of channel A and channel B; When it is detected that the PPS of both channel A and channel B are high, one of them is selected as the reference signal and switched to this channel; When it is continuously detected that the PPS of channels A and B are both at low level, there is no signal source input, and no switching is required; When it is detected that the PPS of channels A and B are not high at the same time and channel A is detected to be high first, it is determined whether the count value of the counter is less than a specified value, and the specified value is the working clock frequency minus one; if it is less than the specified value, both channels A and B have reference signals, and one of them is selected as the reference signal and switched to this channel; if it is greater than or equal to the specified value, only channel A has a reference signal, and channel A is selected as the reference signal and switched to channel A; When it is detected that the PPS of channels A and B are not high at the same time and channel B is detected as high first, it is determined whether the count value of the counter is less than the specified value, and the specified value is the working clock frequency minus one; if it is less than the specified value, both channels A and B have reference signals, and one of them is selected as the reference signal and switched to this channel; if it is greater than or equal to the specified value, only channel B has a reference signal, and channel B is selected as the reference signal and switched to channel B.

2. The fast switching method of second pulses as claimed in claim 1, characterized in that: The rising edge detection method specifically comprises the following steps: S1, synchronously delay the PPS signal by one beat and two beats respectively, to obtain a signal delayed by one clock cycle and a signal delayed by two clock cycles relative to the original PPS signal respectively; S2, inverts the signal delayed by two clock cycles, and performs a logical AND operation with the signal delayed by one clock cycle to obtain a new signal; S3, detecting the obtained new signal, if the new signal is at a high level, a rising edge is detected, if the new signal is not at a high level, no rising edge is detected.

3. The fast switching method of second pulses as claimed in claim 1, characterized in that: The working method of the counter specifically comprises the following steps: Q1, detect the two PPS signals according to the rising edge detection method, and mark the detection results of the two PPS signals; Q2, the result of the OR operation of the two detection results is used as the reset flag of the counter, and the level of the reset flag is determined; Q3, if the clear flag is high, the initial value of the counter is cleared first and then starts counting, until the count value reaches the set maximum value and the counter stops counting; if the clear flag is low, the counter cannot start counting and the counter is in the stop counting state; Q4, when the counter stops counting, it enters Q1 and continuously detects the rising edge signals of the two PPSs.

Citation Information

Patent Citations

  • Seamless switching method for master and slave satellite clocks of navigation satellite

    CN102590825A

  • FPGA (Field Programmable Gate Array)-based measuring system and method for second signal delay time

    CN104714137A