A Manchester decoding device and method based on the OSP protocol

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

CN119652470BActive Publication Date: 2025-05-27TINYCHIP MICROELECTRONICS (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When the existing Manchester decoding method passes long data, due to the accumulation of phase difference, the final data sampling error is caused, which cannot meet the current requirements.

Method used

The high-frequency glitches on the input signal are filtered out through the filtering module, the detection module detects the start and end conditions, the preamble detection module detects the fixed preamble, and the data decoding module identifies levels 0 and 1 by measuring the distance and time interval between different edges to avoid phase difference accumulation.

Benefits of technology

It improves the robustness of Manchester decoding, avoids data sampling errors caused by phase difference accumulation, and can more accurately decode Manchester-encoded signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652470B_ABST
    Figure CN119652470B_ABST
Patent Text Reader

Abstract

The present invention discloses a Manchester decoding device and method based on the OSP protocol. Specifically, the specific steps of the method include: Step S100: Detect the start condition start in the USE detection mode and the LVDS detection mode; Step S200: Detect 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 preamble is a fixed value of 0b1010 by detecting the rising edge and the falling edge; Step S400: Perform Manchester decoding. The present invention effectively avoids the final data sampling error caused by the accumulation of phase differences, and greatly improves the robustness of Manchester decoding.
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 specifically to a Manchester decoding device and method based on the OSP protocol. Background Art

[0002] The SP protocol is a protocol self-developed by Osram. Since there is no separate clock line, it also uses the Manchester coding method. The packet structure of the OSP protocol includes a preamble, and the total word length is at most 12 bytes. The preamble is a fixed value of 1010. The OSP protocol stipulates that each node provides two sets of identical I / O ports, and each set contains two SIOx_P and SIOx_N pins (where x is 1 or 2); reference Figure 1 , shows two internal pin connection diagrams. The connection methods include symmetric connection and cross connection. The symmetric connection is used for the LVDS mode; the cross connection is used for the USE mode; the LVDS mode signal is a differential signal, which are the positive end P and the negative end N respectively, and the signal is bidirectional; in the USE mode, the signal is a single-ended signal, and N and P are used as the RX (receive) and TX (transmit) signals respectively;

[0003] Reference Figure 2 , each node can select different working modes by measuring the port voltage or detecting the pull-up and pull-down resistor values in the port after power-on reset, and different working modes can be identified by detecting different pull-up and pull-down resistors: among them, the physical layers of the USE mode and the LVDS mode are implemented by Manchester coding. In the OSP protocol, the USE mode and the LVDS mode use the Manchester coding 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.

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

[0005] Reference Figure 8, when performing Manchester decoding at the receiving end in the current Manchester decoding method, in order to sample a stable signal, generally the 1 / 4 point and 3 / 4 point of the sampling period are used. So, when the 1 / 4 point samples 0 and the 3 / 4 point samples 1, it is decoded as 1; when the 1 / 4 point samples 1 and the 3 / 4 point samples 0, it is decoded as 0. However, if the signal is sampled at a fixed period, or sampled at a period calculated using a partial signal Preamble, due to the existence of a phase difference, when transmitting long data, this phase difference will accumulate and cause incorrect data sampling at the end.

[0006] The existing technology can no longer meet the needs of people at the present stage. Based on the current situation, it is urgent to improve the existing technology. Summary of the Invention

[0007] The purpose 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.

[0008] On the one hand, the present invention provides the following technical solution: A Manchester decoding device based on the OSP protocol, including: a filtering module, a detection module, a preamble detection module, and a data decoding module;

[0009] The input end of the filtering module is externally connected to an input signal, and the filtering module is an arbitrary low-pass filter for filtering high-frequency spikes on the input signal;

[0010] The output end of the filtering module is respectively connected to the detection module, the preamble detection module, and the data decoding module;

[0011] The detection module includes: a start condition detection module and an end condition detection module; where,

[0012] The start condition detection module is used to detect the start condition start defined in the physical layer of the OSP protocol in the USE detection mode and the LVDS detection mode;

[0013] The end condition detection module is used to detect the end condition stop defined in the physical layer of the OSP protocol in the USE detection mode and the LVDS detection mode;

[0014] The preamble detection module is used to detect that the preamble in the OSP protocol is a fixed value of 0b1010;

[0015] The data decoding module is used to detect the edge transition of the input signal, and realize data decoding by judging and screening out valid edge transitions and converting them into logical values.

[0016] On the other hand, the present invention also provides the following technical solution: A Manchester decoding method based on the OSP protocol, and the specific steps include:

[0017] Step S100: Detect the start condition start in the USE detection mode and the LVDS detection mode;

[0018] Step S200: Detect the end condition stop in the USE detection mode and the LVDS detection mode;

[0019] Step S300: After detecting the start condition start, detect whether the preamble is a fixed 0b1010 value by detecting the rising edge and the falling edge; The steps include:

[0020] Step S301: Start the counter in the preamble detection module at the first rising edge, measure the time interval between the first rising edge and the first falling edge, and mark it as hp_det;

[0021] Step S302: Clear the counter at the first falling edge, and start counting again at the same time, measure the time interval between the first falling edge and the second rising edge, and mark it as lp_det;

[0022] Step S303: Clear the counter at the second rising edge, and start counting again at the same time, measure the time interval between the second rising edge and the second falling edge, and mark it as conf_det.

[0023] Step S304: Calculate the average value of hp_det and lp_det to obtain the estimated period T:

[0024] T = (hp_det + lp_det) / 2

[0025] Step S305: Compare conf_det with the estimated period T to determine whether conf_det is within the range of the estimated period T

[0026] Step S400: Manchester decoding; The steps include:

[0027] Step S401: Find the transition edge of the input signal;

[0028] After detecting the preamble, re-initialize and set the counter to 0, and find the transition edge of the input signal;

[0029] Step S402: Determine whether it is a valid transition edge;

[0030] When a transition is detected, measure the time interval between the current transition and the previous signal transition;

[0031] If the time interval is less than the set threshold, the current transition is not a valid data transition, discard the current transition edge and address the next transition; Among them, the threshold is set based on the estimated period T, and the threshold is used to determine whether it is a transition edge of a valid bit;

[0032] If the time interval between the current transition and the previous signal transition is greater than or equal to the set threshold, then the current transition is a valid data transition, and the type of the current valid transition edge is recorded.

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

[0034] Step S404: After detecting a valid transition edge, clear the counter value, start counting again, and repeat Step S402 until the end condition stop is detected and then end.

[0035] The present invention has the following beneficial effects:

[0036] The present invention does not adopt the fixed-point sampling method in the background technology. Instead, by measuring the distances between different edges (rising edges and falling edges), the levels 0 and 1 are identified through a configurable threshold, and when decoding data, the valid transition edges are obtained by detecting the transition edges and the time intervals between the transition edges, avoiding the final data sampling error caused by the accumulation of phase differences and greatly improving the robustness of Manchester decoding. Description of the Drawings

[0037] Figure 1 It is a schematic structural diagram of the connection relationship between two internal pin structures of a contact in the OSP protocol;

[0038] Figure 2 It is a schematic diagram of the pull-up and pull-down circuits of the node port pin resistors;

[0039] Figure 3 It is a schematic structural diagram of the decoding device of the present invention;

[0040] Figure 4 It is a schematic timing diagram of detecting the start condition start and the end condition stop of the present invention in the USE detection mode and the LVDS detection mode;

[0041] Figure 5 It is a schematic timing diagram of detecting the preamble of the present invention;

[0042] Figure 6 It is a decoding schematic diagram of the present invention when the first bit data is 0;

[0043] Figure 7 It is a decoding schematic diagram of the present invention when the first bit data is 1;

[0044] Figure 8 It is a sampling period schematic diagram of Manchester decoding in the prior art. Detailed Embodiments

[0045] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0046] Reference Figure 3 , on the one hand, the present invention provides the following technical solution: a Manchester decoding device based on the OSP protocol, including: a filtering module, a detection module, a preamble detection module, and a data decoding module;

[0047] The input end of the filtering module is externally connected to an input signal. The filtering module can be any low-pass filter, which is used to filter out high-frequency spikes on the input signal;

[0048] The output end of the filtering module is respectively connected to the detection module, the preamble detection module, and the data decoding module;

[0049] The detection module includes: a start condition detection module and an end condition detection module;

[0050] The start condition detection module is used to detect the start condition start defined in the physical layer of the OSP protocol in the USE detection mode and the LVDS detection mode;

[0051] The end condition detection module is used to detect the end condition stop defined in the physical layer of the OSP protocol in the USE detection mode and the LVDS detection mode;

[0052] The preamble detection module is used to detect that the preamble is a fixed value of 0b1010 in the OSP protocol;

[0053] The data decoding module is used to detect the edge transition of the input signal, and realizes data decoding by judging and screening out valid edge transitions and converting them into logical values.

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

[0055] On the other hand, the present invention also provides another technical solution: a Manchester decoding method based on the OSP protocol, and the specific steps include:

[0056] Step S100: Detect the start condition start in the USE detection mode and the LVDS detection mode;

[0057] In the USE detection mode, the SIOx_N pin is pulled up. When the start condition detection module detects a signal level transition from 1 to 0 on the SIOx_N pin, it is determined that the start condition detection module has detected the start condition start;

[0058] In the LVDS mode, the start condition detection module detects the start sequence on the signal lines of the SIOx_P pin and the SIOx_N pin. When it is detected that at least one of the signal lines on the pins can maintain a logic 1 level for a width of 2 bits, it is determined that the start condition detection module has detected the start condition start; where the start sequence is a parameter indicating the start of the OSP frame;

[0059] Reference Figure 4 As an optional embodiment of the present invention, in this embodiment, in the USE detection mode, when the start condition detection module detects a signal level transition from 1 to 0 at signal point A on the SIOx_N pin, it is determined that the start condition detection module has detected the start condition start; in the LVDS mode, when the start condition detection module detects a start sequence that maintains a logic 1 level for a width of 2 bits from signal point C to signal point D on the SIOx_P pin, it can be determined that the start condition detection module has detected the start condition start;

[0060] Step S200: Detect the end condition stop in the USE detection mode and the LVDS detection mode;

[0061] In the USE detection mode, when the end condition detection module detects a signal level transition from 0 to 1 on the SIOx_N pin and the level remains at 1 for at least 1.5 bits, it is determined that the end condition detection module has detected the end condition stop.

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

[0063] Reference Figure 4, as an alternative embodiment of the present invention, in this embodiment, in the USE detection mode, when the end condition detection module detects a transition from 0 to 1 at signal point B on the SIOx_N pin and the level remains at 1, and since the time of maintaining the level 1 is greater than 1.5 bits, it can be determined that the end condition detection module has detected the end condition stop; in the LVDS mode, when the end condition detection module detects a start sequence of a logic 1 level with a width of 2 bits from signal point E to signal point F on the SIOx_P pin, it can be determined that the end condition detection module has detected the end condition stop.

[0064] Reference Figure 5 , step S300: After detecting the start condition start, by detecting the rising edge and falling edge, detect whether the preamble is a fixed value of 0b1010; the steps include:

[0065] Step S301: Start the counter in the preamble detection module at the first rising edge, measure the time interval between the first rising edge and the first falling edge, and mark it as hp_det;

[0066] Step S302: Clear the counter at the first falling edge, and at the same time start counting again, measure the time interval between the first falling edge and the second rising edge, and mark it as lp_det;

[0067] Step S303: Clear the counter at the second rising edge, and at the same time start counting again, measure the time interval between the second rising edge and the second falling edge, and mark it as conf_det.

[0068] Step S304: Calculate the average value of hp_det and lp_det to obtain the estimated period T:

[0069] T = (hp_det + lp_det) / 2,

[0070] Step S305: Compare conf_det with the period T to determine whether conf_det is within the range of the estimated period T;

[0071] When T + delta > conf_det > T – delta, then conf_det is within the range of the estimated period T, it is considered that the preamble has been detected, and T is used as the detected period value, and at the same time the baud rate is obtained as 1 / T; where delta is a configurable error range;

[0072] When conf_det ≥ T + delta or conf_det ≤ T – delta, conf_det is not within the range of the evaluation period T, and it is considered that no preamble is detected, and the start condition start detection is restarted; where delta is a configurable error range.

[0073] Step S400: Manchester decoding; the steps include:

[0074] Step S401: Find the transition edge of the input signal;

[0075] After detecting the preamble, re-initialize the counter to 0 and find the transition edge of the input signal;

[0076] Step S402: Determine whether it is a valid transition edge;

[0077] When a transition is detected, measure the time interval between this transition and the previous signal transition;

[0078] If the time interval is less than the set threshold, then this transition is not a valid data transition, discard the current transition and address the next transition;

[0079] If the time interval between this transition and the previous signal transition is greater than or equal to the set threshold, then this transition is a valid data transition, and record the type of the current valid transition edge.

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

[0081]

[0082] Step S404: After detecting a valid transition edge, clear the counter value, restart counting, and repeat Step S402 until the end condition stop is detected and the process ends.

[0083] Reference Figure 6 , as an optional embodiment of the present invention, in this embodiment, the first bit data is 0, the set threshold is 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, 0 in sequence;

[0084] Reference Figure 7, as an alternative embodiment of the present invention, in this embodiment, the first bit data is 1, the set threshold is 0.5 cycles, and when determining the valid transition edge, the 4th transition edge is the first valid transition edge. Similarly, it can be deduced that the 5th, 6th, 7th, 9th, and 10th transition edges are all valid transition edges, and the corresponding logical values are 1, 0, 1, 1, and 0 in sequence.

[0085] Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within 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

  • Manchester code data receiver

    JP2005142615A