Manchester decoding device and method based on OSP protocol

By using filtering, detection and preamble detection modules in Manchester decoding, combined with the recognition method of edge distance and time interval, the data sampling error problem caused by phase difference in the prior art is solved, and the robustness of decoding is improved.

CN119652470AActive Publication Date: 2025-03-18TINYCHIP MICROELECTRONICS (SHANGHAI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510156686.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-03-18
Estimated Expiration
2045-02-13

AI Technical Summary

Technical Problem

The existing Manchester decoding method causes data sampling errors due to phase differences when sampling signals, which cannot meet the current requirements.

Method used

The filtering module filters out the high-frequency glitches on the input signal, the detection module detects the start and end conditions, the preamble detection module detects the fixed preamble, and the data decoding module identifies the effective jump edge and realizes data decoding by measuring the distance and time interval between different edges.

Benefits of technology

Data sampling errors caused by phase difference accumulation are avoided, and the robustness of Manchester decoding is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652470A_ABST
    Figure CN119652470A_ABST
Patent Text Reader

Abstract

The invention discloses a Manchester decoding device and method based on an OSP protocol, and the method comprises the specific steps: S100, detecting a start condition in a USE detection mode and an LVDS detection mode; step S200, detecting an end condition stop in the USE detection mode and the LVDS detection mode; s300, after the start condition is detected, detecting whether the lead code is a fixed 0b1010 value or not by detecting a rising edge and a falling edge; and step S400, carrying out Manchester decoding. According to the Manchester decoding method, the final data sampling error caused by phase difference accumulation is effectively avoided, and the robustness of Manchester decoding is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Manchester decoding, and in particular to a Manchester decoding device and method based on an OSP protocol. Background Art

[0002] The SP protocol is a protocol developed by OSRAM. Since there is no separate clock line, it also uses Manchester encoding. The packet structure of the OSP protocol includes a preamble (preamble), the total word length is up to 12 bytes, and the preamble is a fixed value of 1010. The OSP protocol stipulates that each node provides two sets of identical I / O ports, each set contains two SIOx_P and SIOx_N pins (where x is 1 or 2); refer to Figure 1 , shows two internal pin connection diagrams, the connection methods include symmetrical connection and cross connection, symmetrical connection is used for LVDS mode; cross connection is used for USE mode; LVDS mode signal is a differential signal, with positive terminal P and negative terminal N, respectively, and the signal is bidirectional; in USE mode, the signal is a single-ended signal, with N and P as RX (receive) and TX (transmit) signals respectively; refer to Figure 2 Each node can select different working modes by measuring the port voltage after power-on reset or detecting the pull-up and pull-down resistor values ​​in the port, and different working modes can be identified by different pull-up and pull-down resistor detection: the physical layer of USE mode and LVDS mode is implemented through Manchester encoding. The USE mode and LVDS mode in the OSP protocol use the Manchester encoding defined in the IEEE 802.3 standard, that is, logic 1 is encoded as a rising edge and logic 0 is encoded as a falling edge.

[0003] The OSP protocol defines the start (start condition) and stop (end condition) conditions of the physical layer as follows: when the node is in an idle state, if any line changes its state, the start condition can be considered to be met; when the jump on the line ends and the line remains stable for at least the timeout period, the end condition can be considered to be met. The OSP protocol defines a typical OSP transmission rate of 2.4Mbit / s, a timeout period of 2.5bits, and a start / stop sequence of 2bits in LVDS mode.

[0004] refer to Figure 8The current Manchester decoding method is generally to sample a stable signal at the 1 / 4 and 3 / 4 points of the sampling cycle when performing Manchester decoding at the receiving end. Therefore, 0 is sampled at 1 / 4 and 1 is sampled at 3 / 4, and decoded as 1; 1 / 4 is sampled at 1 and 3 / 4 is sampled at 0, and decoded as 0; however, if the signal is sampled at a fixed period, or the period calculated by the partial signal Preamble is used for sampling, due to the phase difference, when transmitting longer data, the phase difference will accumulate and lead to the final data sampling error.

[0005] Existing technologies can no longer meet people's needs at this stage. Based on the current situation, it is urgent to improve existing technologies. Summary of the invention

[0006] The object of the present invention is to provide a Manchester decoding device and method based on the OSP protocol to solve the problems raised in the above background technology.

[0007] On the one hand, the present invention provides the following technical solution: a Manchester decoding device based on the OSP protocol, comprising: a filtering module, a detection module, a preamble detection module, and a data decoding module; The input end of the filter module is externally connected to an input signal, and the filter module is an arbitrary low-pass filter for filtering out high-frequency glitches on the input signal; The output end of the filtering module is connected to the detection module, the preamble detection module and the data decoding module respectively; The detection module includes: a start condition detection module and an end condition detection module; wherein, The start condition detection module is used to detect the start condition start of the physical layer defined in the OSP protocol in the USE detection mode and the LVDS detection mode; The end condition detection module is used to detect the end condition stop of the physical layer defined in the OSP protocol in the USE detection mode and the LVDS detection mode; The preamble detection module is used to detect that the preamble is a fixed 0b1010 value in the OSP protocol; The data decoding module is used to detect the transition edge of the input signal, and realizes data decoding by judging and screening out the effective transition edge and converting it into a logic value.

[0008] On the other hand, the present invention also provides the following technical solution: a Manchester decoding method based on the OSP protocol, the specific steps comprising: Step S100: detecting a start condition start in the USE detection mode and the LVDS detection mode; Step S200: detecting the end condition stop in the USE detection mode and the LVDS detection mode; Step S300: After detecting the start condition start, detect whether the leading code is a fixed 0b1010 value by detecting the rising edge and the falling edge; the steps include: Step S301: start the counter in the preamble code detection module at the first rising edge, measure the time interval between the first rising edge and the first falling edge, marked as hp_det; Step S302: clear the counter at the first falling edge and restart counting to measure the time interval between the first falling edge and the second rising edge, marked as lp_det; Step S303: Clear the counter at the second rising edge and restart counting to measure the time interval from the second rising edge to the second falling edge, marked as conf_det.

[0009] Step S304: Calculate the average value of hp_det and lp_det to obtain the estimation period T: T = (hp_det + lp_det) / 2 Step S305: Compare conf_det with the valuation period T to determine whether conf_det is within the range of the valuation period T. Step S400: Manchester decoding; the steps include: Step S401: Find the transition edge of the input signal; After detecting the preamble, reinitialize the counter to 0 and look for the transition edge of the input signal; Step S402: Determine whether it is a valid transition edge; When a jump is detected, the time interval between this jump and the previous signal jump is measured; If the time interval is less than the set threshold, the current jump is not a valid data jump, and the current jump edge is discarded to address the next jump; wherein, the setting of the threshold is based on the valuation period T, and the threshold is used to determine whether it is a jump edge of a valid bit; If the time interval between this jump and the previous signal jump is greater than or equal to the set threshold, then this jump is a valid data jump, and the type of the current valid jump edge is recorded; Step S403: determining the detected data logic value according to the types of the previous transition edge and the current transition edge; Step S404: When a valid transition edge is detected, the counter value is cleared, counting starts again, and step S402 is repeated until the end condition stop is detected.

[0010] The present invention has the following beneficial effects: The present invention does not adopt the fixed-point sampling method in the background technology, but measures the distance between different edges (rising edge and falling edge), identifies levels 0 and 1 through a configurable threshold, and obtains the effective transition edge by detecting the transition edge and the time interval between the transition edges during data decoding, thereby avoiding the final data sampling error caused by the accumulation of phase difference and greatly improving the robustness of Manchester decoding. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a schematic diagram of the structure of two internal pin connection relationships of contacts in the OSP protocol; Figure 2 It is a schematic diagram of the node port pin resistor pull-up and pull-down circuit; Figure 3 It is a schematic diagram of the structure of the decoding device of the present invention; Figure 4 It is a timing diagram of detecting the start condition start and the end condition stop in the USE detection mode and the LVDS detection mode of the present invention; Figure 5 A timing diagram of detecting a preamble code according to the present invention; Figure 6 This is a decoding schematic diagram of the present invention when the first bit data is 0; Figure 7 This is a decoding schematic diagram of the present invention when the first bit data is 1; Figure 8 It is a schematic diagram of the sampling period of Manchester decoding in the prior art. DETAILED DESCRIPTION

[0012] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field of the present invention without creative work are within the scope of protection of the present invention.

[0013] refer to Figure 3 On the one hand, the present invention provides the following technical solution: a Manchester decoding device based on the OSP protocol, comprising: a filtering module, a detection module, a preamble detection module, and a data decoding module; The input end of the filter module is externally connected to an input signal, and the filter module can be any low-pass filter for filtering out high-frequency glitches on the input signal; The output end of the filtering module is connected to the detection module, the preamble detection module and the data decoding module respectively; The detection module includes: a start condition detection module and an end condition detection module; The start condition detection module is used to detect the start condition start of the physical layer defined in the OSP protocol in the USE detection mode and the LVDS detection mode; The end condition detection module is used to detect the end condition stop of the physical layer defined in the OSP protocol in the USE detection mode and the LVDS detection mode; The preamble detection module is used to detect that the preamble is a fixed 0b1010 value in the OSP protocol; The data decoding module is used to detect the transition edge of the input signal, and realizes data decoding by judging and screening out the effective transition edge and converting it into a logic value.

[0014] In this embodiment, the input signal is first filtered by the filtering module, and then the preamble code detection module starts to detect the preamble code after the start condition detection module detects the start condition start. After the preamble code detects a fixed 0b1010 value, data decoding is performed by the data decoding module; after the end condition detection module detects the end condition stop, data decoding ends.

[0015] On the other hand, the present invention also provides another technical solution as follows: a Manchester decoding method based on the OSP protocol, the specific steps comprising: Step S100: detecting a start condition start in the USE detection mode and the LVDS detection mode; In the USE detection mode, the SIOx_N pin is pulled up. When the start condition detection module detects that the signal on the SIOx_N pin has a level jump from 1 to 0, it is determined that the start condition detection module detects the start condition start; In LVDS mode, the start condition detection module detects the start sequence on the signal lines on the SIOx_P pin and the SIOx_N pin. When it is detected that at least one of the signal lines on the pin can maintain a logic 1 level with a width of 2 bits, it is determined that the start condition detection module detects the start condition start; wherein the start sequence is a parameter indicating the start of the OSP frame; refer to Figure 4 As an optional embodiment of the present invention, in this embodiment, in the USE detection mode, the start condition detection module detects a level jump from 1 to 0 at the signal point A on the SIOx_N pin, and it is determined that the start condition detection module detects the start condition start; in the LVDS mode, the start condition detection module detects a start sequence of a logic 1 level maintaining a width of 2 bits at the signal point C to the signal point D on the SIOx_P pin, and it can be determined that the start condition detection module detects the start condition start; Step S200: detecting the end condition stop in the USE detection mode and the LVDS detection mode; In the USE detection mode, when the end condition detection module detects that the signal on the SIOx_N pin has a level jump from 0 to 1, and the level remains at 1 for at least 1.5 bits, it is determined that the end condition detection module detects the end condition stop.

[0016] In LVDS mode, the stop sequence on the signal lines on the SIOx_P pin and the SIOx_N pin is detected by the end condition detection module. When it is detected that at least one of the signal lines on the pin can maintain a logic 1 level with a width of 2 bits, it is determined that the end condition detection module detects the end condition stop; wherein the stop sequence is used to indicate the end parameter of the OSP frame.

[0017] refer to Figure 4 As an optional embodiment of the present invention, in this embodiment, in the USE detection mode, the end condition detection module detects a level jump from 0 to 1 at the signal point B on the SIOx_N pin, and keeps the level 1. Since the time of keeping the level 1 is greater than 1.5 bits, it can be determined that the end condition detection module detects the end condition stop; in the LVDS mode, the end condition detection module detects a start sequence of a logic 1 level maintaining a width of 2 bits at the signal point E to the signal point F on the SIOx_P pin, and it can be determined that the end condition detection module detects the end condition stop.

[0018] refer to Figure 5 , step S300: after detecting the start condition start, by detecting the rising edge and the falling edge, detect whether the leading code is a fixed 0b1010 value; the steps include: Step S301: start the counter in the preamble code detection module at the first rising edge, measure the time interval between the first rising edge and the first falling edge, marked as hp_det; Step S302: clear the counter at the first falling edge and restart counting to measure the time interval between the first falling edge and the second rising edge, marked as lp_det; Step S303: Clear the counter at the second rising edge and restart counting to measure the time interval from the second rising edge to the second falling edge, marked as conf_det.

[0019] Step S304: Calculate the average value of hp_det and lp_det to obtain the estimation period T: T = (hp_det + lp_det) / 2, Step S305: Compare conf_det with the period T to determine whether conf_det is within the range of the valuation period T; When T +delta> conf_det > T – delta, conf_det is within the estimation period T, the preamble is considered to be detected, and T is taken as the detected period value, and the baud rate is obtained as 1 / T; where delta is a configurable error range; When conf_det≥T +delta or conf_det≤T – delta, conf_det is not within the range of the estimation period T, and it is considered that the preamble is not detected, and the start condition start detection is restarted; delta is a configurable error range.

[0020] Step S400: Manchester decoding; the steps include: Step S401: Find the transition edge of the input signal; After detecting the preamble, reinitialize the counter to 0 and look for the transition edge of the input signal; Step S402: Determine whether it is a valid transition edge; When a jump is detected, the time interval between this jump and the previous signal jump is measured; If the time interval is less than the set threshold, the current jump is not a valid data jump, and the current jump is discarded to address the next jump; If the time interval between this jump and the previous signal jump is greater than or equal to the set threshold, the current jump is a valid data jump, and the type of the current valid jump edge is recorded.

[0021] Step S403: Determine the detected data logic value according to the types of the previous transition edge and the current transition edge:

[0022] Step S404: When a valid transition edge is detected, the counter value is cleared, counting starts again, and step S402 is repeated until the end condition stop is detected.

[0023] refer to Figure 6 As an optional embodiment of the present invention, in this embodiment, the first bit data is 0, the threshold value is set to 0.5 cycles, and when judging the valid transition edge, the 4th transition edge is the first valid transition edge. Similarly, it can be deduced that the 6th, 7th, 9th, 10th, and 12th transition edges are all valid transition edges, and the corresponding logic values ​​are 0, 1, 1, 0, and 0, respectively; refer to Figure 7As an optional embodiment of the present invention, in this embodiment, the first bit data is 1, and the set threshold is 0.5 cycles. When judging the valid transition edge, the 4th transition edge is the first valid transition edge. Similarly, it can be inferred that the 5th, 6th, 7th, 9th, and 10th transition edges are all valid transition edges, and the corresponding logic values ​​are 1, 0, 1, 1, and 0 respectively.

[0024] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A Manchester decoding method based on OSP protocol, characterized in that: The specific steps include: Step S100: detecting a start condition start in a USE detection mode and a LVDS detection mode; wherein the USE detection mode and the LVDS detection mode are two working modes in the OSP protocol; Step S200: detecting the end condition stop in the USE detection mode and the LVDS detection mode; Step S300: After detecting the start condition start, detect whether the leading code is a fixed value of 0b1010 by detecting the rising edge and the falling edge; Step S400: Manchester decoding, which includes: Step S401: Find the transition edge of the input signal; After detecting the preamble, reinitialize the counter to 0 and look for the transition edge of the input signal; Step S402: Determine whether it is a valid transition edge; When a jump is detected, the time interval between this jump and the previous signal jump is measured; If the time interval is less than the set threshold, the current jump is regarded as a non-valid data jump, the current jump edge is discarded, and the next jump is addressed; If the time interval between this jump and the previous signal jump is greater than or equal to the set threshold, this jump is considered a valid data jump, and the type of the current valid jump edge is recorded; Step S403: determining the detected data logic value according to the types of the previous transition edge and the current transition edge; Step S404: When a valid transition edge is detected, the counter value is cleared, counting starts again, and step S402 is repeated until the end condition stop is detected.

2. The Manchester decoding method based on OSP protocol according to claim 1, characterized in that: Step S100 includes: In USE detection mode, the SIOx_N pin is pulled up. When a transition from 1 to 0 is detected on the signal on the SIOx_N pin, the start condition is detected.

3. The Manchester decoding method based on OSP protocol according to claim 1, characterized in that: Step S100 includes: In LVDS mode, detect the start sequence on the signal lines on the SIOx_P pin and SIOx_N pin; When it is detected that there is at least one signal line on the pin that can maintain a logic 1 level with a width of 2 bits, it is determined that the start condition start is detected; wherein the start sequence is a starting parameter indicating an OSP frame.

4. The Manchester decoding method based on OSP protocol according to claim 1, characterized in that: Step S200 includes: In USE detection mode, when the signal on the SIOx_N pin is detected to have a level transition from 0 to 1, and the level remains at 1 for at least 1.5 bits, it is determined that the end condition stop is detected.

5. The Manchester decoding method based on OSP protocol according to claim 1, characterized in that: Step S200 includes: In LVDS mode, detect the stop sequence on the signal lines on the SIOx_P pin and the SIOx_N pin; When it is detected that there is at least one signal line on the pin that can maintain a logic 1 level with a width of 2 bits, it is determined that the end condition stop is detected; wherein the stop sequence is used to indicate the end parameter of the OSP frame.

6. The Manchester decoding method based on OSP protocol according to claim 1, characterized in that: Step S300 includes: Step S301: start the counter in the preamble code detection module at the first rising edge, measure the time interval between the first rising edge and the first falling edge, marked as hp_det; Step S302: clear the counter at the first falling edge and restart counting to measure the time interval between the first falling edge and the second rising edge, marked as lp_det; Step S303: clear the counter at the second rising edge and restart counting to measure the time interval from the second rising edge to the second falling edge, marked as conf_det; Step S304: Calculate the average value of hp_det and lp_det to obtain the estimation period T: T = (hp_det + lp_det) / 2; Step S305: Compare conf_det with the valuation period T to determine whether conf_det is within the range of the valuation period T.

7. The Manchester decoding method based on OSP protocol according to claim 6, characterized in that: When T +delta>conf_det > T – delta, conf_det is within the range of the estimation period T, the preamble is detected, and the estimation period T is used as the detected period value, and the baud rate is obtained as 1 / T; where delta is a configurable error range; When conf_det≥T +delta or conf_det≤T – delta, the start condition start detection is restarted; where delta is a configurable error range.

8. The Manchester decoding method based on OSP protocol according to claim 1, characterized in that: Step S403 includes: When the previous signal valid transition edge is a falling edge and the current signal valid transition edge is a falling edge, the detected logic value is 0; When the previous signal valid transition edge is a falling edge and the current signal valid transition edge is a rising edge, the detected logic value is 1; When the previous signal valid transition edge is a rising edge and the current signal valid transition edge is a falling edge, the detected logic value is 0; When the previous signal valid transition edge is a rising edge and the current signal valid transition edge is a rising edge, the detected logic value is 1.

9. A Manchester decoding device based on OSP protocol, characterized in that: The Manchester decoding method based on the OSP protocol applied to any one of claims 1 to 8 comprises: a filtering module, a detection module, a preamble detection module, and a data decoding module; The input end of the filter module is externally connected to an input signal, and the filter module is an arbitrary low-pass filter for filtering out high-frequency glitches on the input signal; The output end of the filtering module is connected to the detection module, the preamble detection module and the data decoding module respectively; The detection module includes: a start condition detection module and an end condition detection module; wherein, The start condition detection module is used to detect the start condition start of the physical layer defined in the OSP protocol in the USE detection mode and the LVDS detection mode; The end condition detection module is used to detect the end condition stop of the physical layer defined in the OSP protocol in the USE detection mode and the LVDS detection mode; The preamble detection module is used to detect that the preamble is a fixed 0b1010 value in the OSP protocol; The data decoding module is used to detect the transition edge of the input signal, and realizes data decoding by judging and screening out the effective transition edge and converting it into a logic value.

10. The Manchester decoding device based on OSP protocol according to claim 9, characterized in that: The preamble code detection module starts detecting the preamble code only after the start condition detection module detects the start condition start; and, After the preamble is detected to be a fixed value of 0b1010, the data decoding module is used to decode the data; and, When the end condition detection module detects the end condition stop, the data decoding ends.

Citation Information

Patent Citations

  • Decoding system and decoding method for Manchester codes

    CN108512552A

  • BMC code decoding system

    CN211018863U

  • Manchester code data receiver

    JP2005142615A

  • Manchester coding system for modulating data for use in a local communication system

    KR1020000039664A

  • Method for retrieving data from ultra wideband radio transmission signals and receiver implementing said method

    US20100309875A1