A Manchester code decoding method based on FPGA and IEC60044-8 standard

Through the Manchester code decoding method based on FPGA and IEC60044-8 standards, the problems of high clock requirements and complex logic in Manchester code decoding technology are solved, and high-speed Manchester code decoding with low clock frequency and simple logic are realized, which is suitable for power system equipment communication .

CN111769835BActive Publication Date: 2024-11-26BEIJING ELECTRIC POWER AUTOMATION EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010632470.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-03
Publication Date
2024-11-26
Estimated Expiration
2040-07-03

AI Technical Summary

Technical Problem

The existing Manchester code decoding technology has too high clock requirements and complex decoding logic, making it difficult to efficiently handle high-speed data transmission.

Method used

The Manchester code decoding method based on FPGA and IEC60044-8 standards is adopted to generate a receiving clock through filtering processing, detect frame headers, generate a decoding clock, and use the decoding clock to sample the Manchester code to realize the decoding of the Manchester code.

Benefits of technology

Reduces clock frequency requirements, simplifies decoding logic, improves processing speed, is suitable for high-speed Manchester code decoding, and is suitable for power system equipment communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111769835B_ABST
    Figure CN111769835B_ABST
Patent Text Reader

Abstract

The present invention provides a Manchester code decoding method based on FPGA and IEC60044-8 standard, the Manchester code decoding method includes step S1, filtering the Manchester code signal; step S2, generating a receiving clock and using it to detect the level signal in the Manchester code, the frequency of the receiving clock is twice the frequency of the encoding clock; step S3, aligning the falling edge of the receiving clock with the level falling edge of the Manchester code; step S4, using the receiving clock to detect the frame header; step S5, generating a decoding clock with the same frequency as the encoding clock, step S6, decoding, using the decoding clock to sample the Manchester code detected by the receiving clock, and obtaining the bit information of the Manchester code. The present invention well solves the problems of the Manchester code decoding existing in the prior art that the clock requirement is too high and the decoding logic is relatively complex.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of power system equipment communication, and in particular relates to a Manchester code decoding method based on FPGA and IEC60044-8 standard. Background Art

[0002] Manchester coding is a self-synchronous coding method, that is, the clock synchronization signal is hidden in the data waveform. The principle of Manchester coding level transition is: a falling edge transition at the middle of the clock signal represents 0, and a rising edge transition represents 1. This can prevent the loss of clock synchronization, or data reception errors caused by the asynchrony between the clock and data transmission. However, each code element is adjusted to two levels, so the data transmission rate is only half of the modulation rate.

[0003] When decoding, the clock and data signals in the Manchester code need to be separated from the received signal. Generally, oversampling is used. It is recommended to use a clock signal with a frequency 16 times that of the Manchester code signal, and a clock signal with the same frequency as the Manchester code is required. The Manchester code is sampled at a high frequency. If the current sampled value is different from the previous sampled value, that is, the transition edge of the Manchester code is detected, data decoding can be performed.

[0004] Manchester code decoding in the prior art has the problems of too high clock requirements and relatively complex decoding logic. Therefore, it is necessary to provide an improved technical solution to address the shortcomings of the prior art. Summary of the invention

[0005] The purpose of the present invention is to provide a Manchester decoding method based on FPGA and IEC60044-8 standard to solve the problems in the prior art that Manchester decoding has too high clock requirements and the decoding logic is relatively complex.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] The present invention provides a Manchester code decoding method based on FPGA and IEC60044-8 standard, characterized in that the Manchester code decoding method comprises the following steps:

[0008] Step S1, filtering the Manchester code signal;

[0009] Step S2, generating a receiving clock, wherein the receiving clock is used to detect the level signal in the Manchester code, and the frequency of the receiving clock is twice the frequency of the encoding clock;

[0010] Step S3, aligning the falling edge of the receiving clock with the falling edge of the Manchester code level;

[0011] Step S4, using the receiving clock to detect the frame header, the frame header corresponds to the level of the Manchester code;

[0012] Step S5, generating a decoding clock with the same frequency as the encoding clock, wherein the decoding clock can be used to parse the Manchester code;

[0013] Step S6, decoding, using the decoding clock to sample the Manchester code detected by the receiving clock to obtain the bit information of the Manchester code.

[0014] According to the above-mentioned Manchester code decoding method based on FPGA and IEC60044-8 standard, as a preferred solution, step S4 is specifically: when the receiving clock detects the frame header, a decoding clock with the same frequency as the encoding clock is generated; when the receiving clock does not detect the frame header, the receiving clock continues to be used to detect the frame header.

[0015] According to the Manchester code decoding method based on FPGA and IEC60044-8 standard, as a preferred solution, the filtering process performed in step S1 is to filter out short pulses in the Manchester code signal.

[0016] According to the above-mentioned Manchester code decoding method based on FPGA and IEC60044-8 standard, as a preferred solution, the filtering process is specifically to store the input Manchester code into the cache, always detect the Manchester code data in the cache, when all detected are 0, the output Manchester code is 0, when all detected are 1, the output Manchester code is 1, when both 0 and 1 are detected, the output Manchester code remains unchanged from the previous state.

[0017] According to the above Manchester code decoding method based on FPGA and IEC60044-8 standard, as a preferred solution, the filter completely filters out glitches less than 4 filter clocks.

[0018] According to the above Manchester code decoding method based on FPGA and IEC60044-8 standard, as a preferred solution, the rising edge of the received clock in step S3 corresponds to the middle position of two adjacent level jumps of the Manchester code.

[0019] According to the above Manchester code decoding method based on FPGA and IEC60044-8 standard, as a preferred solution, the frame header in step S4 is a frame header specified by the IEC60044-8 standard.

[0020] Compared with the closest prior art, the technical solution provided by the present invention has the following excellent effects:

[0021] The present invention provides a Manchester code decoding method based on FPGA and IEC60044-8 standard to solve the problems of Manchester code decoding having too high clock requirements and relatively complex decoding logic in the prior art. Field programmable gate array FPGA can handle high-speed calculations compared to single-chip microcomputer or digital signal processor DSP due to its parallel processing characteristics, and is suitable for high-speed Manchester code decoding. IEC60044-8 standard specifies the electronic mutual inductor communication protocol, which is also widely used in power system equipment communication, and the protocol adopts Manchester code.

[0022] The present invention only requires a higher clock frequency in the filter part, but it is still lower than the frequency required by the commonly used Manchester code decoding method, that is, 16 times the Manchester code signal frequency, and the rest of the part is at most 2 times the Manchester code frequency. The control logic is relatively simple, the FPGA code writing workload is small, and the timing requirement is low. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 4 is a schematic diagram of the Manchester code decoding process in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present invention are described clearly and completely below. 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 this field based on the embodiments of the present invention belong to the scope of protection of the present invention.

[0025] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0026] like Figure 1 As shown, the present invention provides a Manchester code decoding method based on FPGA and IEC60044-8 standard, and the Manchester code decoding method comprises the following steps:

[0027] Step S1, filtering the Manchester code signal, storing the input Manchester code into the cache, always detecting the Manchester code in the cache, after filtering, if all detected are 0, the output is 0, if all detected are 1, the output is 1, if the detected data are both 0 and 1, the output Manchester code keeps the previous output state unchanged.

[0028] Step S2, generating a receiving clock, the receiving clock is used to detect the level signal in the Manchester code, and the frequency of the receiving clock is twice the frequency of the encoding clock.

[0029] Step S3, the falling edge of the receiving clock is aligned with the falling edge of the Manchester code level. At this time, the rising edge of the receiving clock corresponds to the middle of two adjacent level jumps of the Manchester code, which is conducive to the receiving clock reading a stable Manchester level.

[0030] Step S4, using the receiving clock to detect the frame header, using the frame header of the receiving clock specified in the IEC60044-8 standard. When the receiving clock detects the frame header, a decoding clock with the same frequency as the encoding clock is generated; when the receiving clock does not detect the frame header, the receiving clock continues to be used to detect the frame header; of course, in specific applications, different devices use different standards for detection, and there are also differences in frame headers.

[0031] Step S5, generating a decoding clock with the same frequency as the encoding clock, and the decoding clock can be directly used to parse the Manchester code.

[0032] Step S6, decoding, using a decoding clock to sample the level of the Manchester code detected by the receiving clock to obtain specific bit information represented by the Manchester code.

[0033] In order to better understand the present invention, a group of embodiments are used below to further explain the present invention, taking Manchester code transmission information 10Mbit / s, and its corresponding encoding clock is 10MHz as an example:

[0034] Step S1, filter the Manchester code signal, filter out short pulses, use 120MHz clock to perform filtering operation, the logic of filtering operation is to store the input Manchester data into a buffer with a width of 4, and keep detecting the Manchester data in the buffer. If all are 0, the output data is 0, and if all are 1, the output is 1. If the data has both 0 and 1, the output data keeps the last output state unchanged. The filter delays 4 clocks for the normal waveform, and the burrs less than 4 clocks are completely filtered out.

[0035] The burrs are completely filtered out. Specifically, for example, the data 1111 1111 1111 becomes 1111 111111111 after filtering; the data 1111 0111 1111 becomes 1111 1111 1111 after filtering; the data 1111 0011 1111 becomes 1111 1111 1111 after filtering; the data 1111 0001 1111 becomes 1111 1111 1111 after filtering; the data 1111 0000 1111 becomes 1111 0000 1111 after filtering;

[0036] Step S2, generating a receiving clock, the receiving clock is used to detect the level signal in the Manchester code, and the frequency of the receiving clock is twice the frequency of the encoding clock, that is, a receiving clock of 20 MHz.

[0037] Step S3, aligning the falling edge of the receiving clock with the falling edge of the Manchester code level. At this time, the rising edge of the receiving clock basically corresponds to the middle of two adjacent Manchester level jumps, which is conducive to reading a stable Manchester level.

[0038] Step S4, using the receiving clock to detect the frame header, the frame header in the embodiment of the present invention is the hexadecimal data 0564, and the corresponding Manchester level is the hexadecimal data AA99969A; for example, the hexadecimal data is converted to binary as 0101, and converted to the Manchester level as the hexadecimal data 99.

[0039] Step S5, generating a 10 MHz decoding clock with the same frequency as the encoding clock, and the decoding clock can be directly used to parse the Manchester code.

[0040] Step S6, decoding, using the decoding clock to sample the Manchester code level detected by the receiving clock to obtain a 20Mbit / s Manchester level signal, and the 10MHz decoding clock samples this to achieve Manchester code decoding, and obtain the 10Mbit / s bit information contained in the Manchester level signal, and then the bit information can be converted into bytes, and then the bytes are verified or CRC (Cyclic Redundancy Check) verification is performed. After the verification is successful, the specific communication content can be obtained.

[0041] In summary, the present invention provides a Manchester code decoding method based on FPGA and IEC60044-8 standard to solve the problems of Manchester code decoding in the prior art that the clock requirement is too high and the decoding logic is relatively complex. Due to its parallel processing characteristics, the field programmable gate array FPGA can handle high-speed calculations compared to a single-chip microcomputer or a digital signal processor DSP, and is suitable for high-speed Manchester code decoding. The IEC60044-8 standard specifies the electronic mutual inductor communication protocol, which is also widely used in power system equipment communication. The protocol uses Manchester code.

[0042] The present invention only requires a higher clock frequency in the filter part, but it is still lower than the frequency required by the commonly used Manchester code decoding method, that is, 16 times the Manchester code signal frequency, and the rest of the part is at most 2 times the Manchester code frequency. The control logic is relatively simple, the FPGA code writing workload is small, and the timing requirement is low.

[0043] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are within the scope of protection of the pending claims of the present invention.

Claims

1. A Manchester code decoding method based on FPGA and IEC60044-8 standard, characterized in that: The Manchester code decoding method comprises the following steps: Step S1, filtering the Manchester code signal; Step S2, generating a receiving clock, wherein the receiving clock is used to detect the level signal in the Manchester code, and the frequency of the receiving clock is twice the frequency of the encoding clock; Step S3, aligning the falling edge of the receiving clock with the falling edge of the Manchester code level; Step S4, using the receiving clock to detect the frame header, the frame header corresponds to the level of the Manchester code; Step S5, generating a decoding clock with the same frequency as the encoding clock, wherein the decoding clock can be used to parse the Manchester code; Step S6, decoding, using a decoding clock to sample the Manchester code detected by the receiving clock to obtain bit information of the Manchester code; The filtering process in step S1 is to filter out the short pulses in the Manchester code signal; the filtering process is specifically to store the input Manchester code into a cache with a width of 4, always detect the Manchester code data in the cache, when all detected are 0, the output Manchester code is 0, when all detected are 1, the output Manchester code is 1, when both 0 and 1 are detected, the output Manchester code remains unchanged from the previous state, the filter delays 4 clocks for the normal waveform, and the burrs less than 4 clocks are completely filtered out; The step S4 specifically comprises: when the receiving clock detects the frame header, generating a decoding clock with the same frequency as the encoding clock; When the receiving clock fails to detect the frame header, the receiving clock continues to be used to detect the frame header.

2. The Manchester code decoding method based on FPGA and IEC60044-8 standard according to claim 1, characterized in that: The rising edge of the received clock in step S3 corresponds to the middle position of two adjacent level jumps of the Manchester code.

3. The Manchester code decoding method based on FPGA and IEC60044-8 standard according to claim 1, characterized in that: The frame header in step S4 is based on the frame header specified by the IEC60044-8 standard.