CN106982199B - Manchester code communication protocol self-adaption method based on FPGA and CPLD - Google Patents

Manchester code communication protocol self-adaption method based on FPGA and CPLD Download PDF

Info

Publication number
CN106982199B
CN106982199B CN201610298665.4A CN201610298665A CN106982199B CN 106982199 B CN106982199 B CN 106982199B CN 201610298665 A CN201610298665 A CN 201610298665A CN 106982199 B CN106982199 B CN 106982199B
Authority
CN
China
Prior art keywords
data
receiving
code
cpld
decoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610298665.4A
Other languages
Chinese (zh)
Other versions
CN106982199A (en
Inventor
朱建国
杨耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Winline Technology Co Ltd
Original Assignee
Shenzhen Winline Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Winline Technology Co Ltd filed Critical Shenzhen Winline Technology Co Ltd
Priority to CN201610298665.4A priority Critical patent/CN106982199B/en
Publication of CN106982199A publication Critical patent/CN106982199A/en
Application granted granted Critical
Publication of CN106982199B publication Critical patent/CN106982199B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Communication Control (AREA)

Abstract

The invention relates to a Manchester code communication protocol self-adaption method based on FPGA and CPLD, which comprises the following steps: and presetting data receiving, decoding, encoding and transmitting modules of different Manchester code communication protocols. The self-adaptive method of the Manchester code communication protocol based on the FPGA/CPLD automatically identifies the frame format of input data, reads the data content and selects the matched frame format of output data. Different communication protocols adopted by different systems can be realized by the same FPGA/CPLD same code, and a self-adaptive data link layer protocol component with a universal interface and easily expanded functions is completed, so that the communication requirements under various industrial control system conditions can be better met.

Description

Manchester code communication protocol self-adaption method based on FPGA and CPLD
Technical Field
The invention provides a Manchester code communication protocol self-adaption method based on an FPGA and a CPLD, and belongs to the field of industrial control automation communication.
Background
Compared with binary codes, the Manchester code has the following advantages: jumping is carried out in the middle of each bit code element in the waveform, so that a receiving end can extract a clock signal conveniently; no direct current component can reduce the power consumption of the system during transmission; the Manchester code transmission mode is very suitable for fast switching of multi-path data. Manchester codes are widely used in many fields, such as telecommunications, industrial control, vehicle buses, oil exploration wells, and the like.
Chinese patent CN105187070A discloses a manchester encoded signal decoding method, which comprises: receiving a Manchester coded signal; determining a sampling period according to the theoretical head level duration of the Manchester coded signal, uniformly setting a plurality of sampling points with the same number in the front sampling period and the rear sampling period of each code element, and acquiring a high level and a low level corresponding to each sampling point; correcting the Manchester coded signal according to the number of high level sampling points in the front sampling period and the rear sampling period of the code element; the modified data signal is decoded according to the manchester encoding rules. The invention can only identify a single Manchester code communication protocol, and has no universality and compatibility in the current complex and diversified industrial control systems.
Chinese patent CN103888143A discloses a manchester code receiving circuit, which includes: an analog circuit configured to convert an analog signal received through the communication transmission path into a digital signal based on a manchester code; and a characteristic compensation unit configured to compensate at least one of a rising delay characteristic in which a rising time of the digital signal is greater than a falling time and a falling delay characteristic in which a falling time of the digital signal is greater than a rising time. The circuit of the invention comprises an analog circuit and a digital circuit, the integrity of signals is unreliable, and the circuit is complicated.
Disclosure of Invention
In order to solve the above problems, the present invention provides a manchester code communication protocol adaptive method based on FPGA and CPLD, comprising:
the method comprises the steps that data receiving, decoding, encoding and transmitting modules of different Manchester code communication protocols are preset, the receiving and decoding modules are used for receiving data from a data link layer and analyzing the data into address codes and data codes, and the encoding and transmitting modules are used for compiling the address codes and the data codes into data frames of different formats and transmitting the data frames out of the data link layer.
The data frame format identification and adaptation module extracts the address code and the data code of the current effective data frame format and transmits the address code and the data code to the application layer, and simultaneously defines the formats of the address code and the data code for the data transmitted to the data link layer by the application layer.
The self-adaptive method of the Manchester code communication protocol based on the FPGA/CPLD automatically identifies the frame format of input data, reads the data content and selects the matched frame format of output data. Different communication protocols adopted by different systems can be realized by the same FPGA/CPLD same code, and a self-adaptive data link layer protocol component with a universal interface and easily expanded functions is completed, so that the communication requirements under various industrial control system conditions can be better met.
Drawings
Fig. 1 shows a method for decoding a manchester code signal in the prior art.
FIG. 2 is a block diagram of a Manchester code communication protocol adaptation method based on FPGA/CPLD according to the present invention.
Detailed Description
The invention discloses a self-adaptive method of a Manchester code communication protocol based on an FPGA/CPLD, which comprises the following steps: the method comprises the steps that data receiving, decoding, encoding and transmitting modules of different Manchester code communication protocols are preset, the receiving and decoding modules are used for receiving data from a data link layer and analyzing the data into address codes and data codes, and the encoding and transmitting modules are used for compiling the address codes and the data codes into data frames of different formats and transmitting the data frames out of the data link layer.
A communication protocol identification and processing method which takes programmable logic devices such as FPGA, CPLD and the like as carriers and takes Manchester codes as encoding rules; the data received from the port is analyzed into an address code, a data code and a data valid bit mark through a receiving and decoding module; the data frame format identification and adaptation module transmits the data content to a corresponding register according to the data valid bit and the address code, and sends an enabling signal to the decoding and sending module; the application layer receives the data from the data frame identification and adaptation module, and allocates an address code to the data to be output and transmits the data to the coding and sending module; and finally, selecting a coding and transmitting module matched with the format of the received data frame according to the enabling bit to transmit signals.
The self-adaptive method for the Manchester code communication protocol based on the FPGA and the CPLD comprises the steps that a plurality of receiving and decoding modules are preset, all the receiving and decoding modules count the length of each frame of data, effective bit marks are output when the length of each data frame is matched with the length setting arranged in the receiving and decoding modules, each module processes a signal in a data frame format, namely the Manchester code communication protocol, the number of the receiving and decoding modules is determined according to the number of protocols which are required to be compatible, and the receiving and encoding modules output address codes, data codes and effective flag bits.
According to the self-adaptive method of the Manchester code communication protocol based on the FPGA and the CPLD, the data frame format identification and adaptation module receives output signals of all receiving and decoding modules, only one communication protocol is arranged under a pair of communication devices, only one of the corresponding receiving and decoding modules works effectively and can give a valid bit mark, the data frame format identification and adaptation module selects one receiving and decoding module to output according to the valid bit mark, the output of other receiving and decoding modules is filtered, and the application layer reads data contents from the data frame format identification and adaptation module.
The self-adaptive method of the Manchester code communication protocol based on the FPGA and the CPLD is characterized in that a plurality of coding and transmitting modules are preset corresponding to the receiving and decoding modules, each data frame format is provided with a unique receiving and decoding module and a coding and transmitting module, an application layer transmits data to be output to all the coding and transmitting modules, and only one coding and transmitting module outputs the data to be output from a transmitting port according to a transmitting enabling bit.
As shown in fig. 2, the manchester code communication protocol adaptation method based on the FPGA and the CPLD includes the following steps (taking a data frame format n as an example):
the method comprises the following steps: the port receives Manchester code communication protocol data with a frame data frame format n, all receiving and decoding modules process the frame data, but only the receiving and decoding module capable of processing the frame format n can output a valid bit mark, and the receiving and decoding module (protocol n) outputs an address code, a data code and a valid bit (n) mark;
step two:
3) the data frame format identification and adaptation module selects an address code with a valid bit (n) mark and a data code (n) to be processed and then transmits the processed data code to an application layer;
4) the data frame format identification and adaptation module outputs a sending enable bit (n);
step three: the application layer transmits the data to all the coding and sending modules; the enable bit (n) enables encoding, sending the output data of the module (protocol n) to the output port.
The self-adaptive method for the Manchester code communication protocol based on the FPGA and the CPLD supports all the Manchester code communication protocols based on the FPGA and the CPLD, and the communication protocols are different according to the different frame lengths of the Manchester code data.
The foregoing description is intended to be illustrative rather than limiting, and it will be appreciated by those skilled in the art that many modifications, variations or equivalents may be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (6)

1. A Manchester code communication protocol self-adaption method based on FPGA and CPLD is characterized in that: presetting data receiving, decoding, encoding and transmitting modules of different Manchester code communication protocols, wherein:
the receiving and decoding module is used for receiving data from a data link layer and analyzing the data into an address code and a data code;
the coding and sending module is used for compiling the address codes and the data codes into data frames in different formats and sending the data frames out of a data link layer;
the data frame format identification and adaptation module is used for taking out an address code and a data code of a currently effective data frame format and transmitting the address code and the data code to an application layer, and simultaneously limiting the formats of the address code and the data code for data transmitted to a data link layer by the application layer;
the self-adaptive method for the Manchester code communication protocol based on the FPGA and the CPLD comprises the following steps: a communication protocol identification and processing method which takes FPGA and CPLD programmable logic devices as carriers and takes Manchester codes as encoding rules; the data received from the port is analyzed into an address code, a data code and a data valid bit mark through a receiving and decoding module; the data frame format identification and adaptation module transmits the data content to a corresponding register according to the data valid bit and the address code, and sends an enabling signal to the decoding and sending module; the application layer receives the data from the data frame identification and adaptation module, and allocates an address code to the data to be output and transmits the data to the coding and sending module; and finally, selecting a coding and transmitting module matched with the format of the received data frame according to the enabling bit to transmit signals.
2. The adaptive method for manchester code communication protocols based on the FPGA and the CPLD as claimed in claim 1, wherein a plurality of receiving and decoding modules are preset, all the receiving and decoding modules count the length of each frame of data, when the length of the data frame matches with the respective built-in length setting, a valid bit identifier is output, each receiving and decoding module processes a signal in a data frame format, i.e. a manchester code communication protocol, the number of the receiving and decoding modules is determined according to the number of protocols to be compatible, and the receiving and encoding modules output address codes, data codes and valid flag bits.
3. The manchester code communication protocol adaptation method based on FPGA and CPLD as claimed in claim 1, wherein the data frame format recognition and adaptation module receives output signals of all receiving and decoding modules, there is only one communication protocol under a pair of communication devices, only one of the corresponding receiving and decoding modules is active and can give an active bit flag, the data frame format recognition and adaptation module selects one of the receiving and decoding modules to output according to the active bit flag, and filters outputs of the other receiving and decoding modules, the application layer reads data content from the data frame format recognition and adaptation module.
4. The adaptive method for manchester code communication protocol based on FPGA and CPLD of claim 1, wherein a plurality of encoding and transmitting modules are preset corresponding to the receiving and decoding modules, each data frame format has a unique receiving and decoding module and an encoding and transmitting module, the application layer transmits data to be output to all the encoding and transmitting modules, and only one encoding and transmitting module outputs data to be transmitted from the transmitting port according to the transmitting enable bit.
5. The manchester code communication protocol adaptation method based on the FPGA and the CPLD of claim 1, comprising the steps of:
the method comprises the following steps: the port receives Manchester code communication protocol data with a frame data frame format n, all receiving and decoding modules process the frame data, but only the receiving and decoding module capable of processing the frame format n can output an effective bit mark, and the receiving and decoding module of the protocol n outputs an address code, a data code and an effective bit mark;
step two:
the data frame format identification and adaptation module selects an address code with a valid bit mark and a data code n to be processed and then transmits the processed data code n to an application layer;
the data frame format identification and adaptation module outputs a sending enable bit n;
step three: the application layer transmits the data to all the coding and sending modules; and transmitting the encoding of the enabling bit n enabling protocol n and the output data of the transmitting module to an output port.
6. The adaptive method for manchester code communication protocols based on FPGA and CPLD as claimed in claim 1, supporting all manchester code communication protocols based on FPGA and CPLD, wherein the communication protocols are different according to the frame length of manchester code data.
CN201610298665.4A 2016-05-06 2016-05-06 Manchester code communication protocol self-adaption method based on FPGA and CPLD Active CN106982199B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610298665.4A CN106982199B (en) 2016-05-06 2016-05-06 Manchester code communication protocol self-adaption method based on FPGA and CPLD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610298665.4A CN106982199B (en) 2016-05-06 2016-05-06 Manchester code communication protocol self-adaption method based on FPGA and CPLD

Publications (2)

Publication Number Publication Date
CN106982199A CN106982199A (en) 2017-07-25
CN106982199B true CN106982199B (en) 2020-04-14

Family

ID=59340102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610298665.4A Active CN106982199B (en) 2016-05-06 2016-05-06 Manchester code communication protocol self-adaption method based on FPGA and CPLD

Country Status (1)

Country Link
CN (1) CN106982199B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014480A (en) * 2019-12-20 2021-06-22 中国科学院沈阳自动化研究所 Industrial edge intelligent gateway based on FPGA technology
CN111934537B (en) * 2020-08-21 2023-07-21 湖北师范大学 Anti-interference method for driving signals of cascade converter

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728713A (en) * 2004-07-27 2006-02-01 邓里文 Method for transmtitig digital video
CN1842069A (en) * 2005-03-31 2006-10-04 欧姆龙株式会社 Received data compensating device
CN101184030A (en) * 2007-11-06 2008-05-21 浙江工业大学 FPGA based Ethernet interface drive set
CN101478466A (en) * 2009-01-16 2009-07-08 中国北车股份有限公司大连电力牵引研发中心 MVB analogue signal input module based on FPGA
CN101976074A (en) * 2010-11-03 2011-02-16 浙江工业大学 Industrial control system based on field bus and control network
CN102045334A (en) * 2010-09-27 2011-05-04 北京泰豪智能工程有限公司 Protocol conversion method and device
CN102098131A (en) * 2009-12-15 2011-06-15 航天科工惯性技术有限公司 Dynamic parameter configuration-based general framing and de-framing method for serial port data frames
CN102103701A (en) * 2009-12-16 2011-06-22 索尼公司 Signal processing apparatus and signal processing method
CN102170326A (en) * 2011-03-23 2011-08-31 武汉华中数控股份有限公司 Serial communication method of position measuring equipment and device thereof
CN102394655A (en) * 2011-10-31 2012-03-28 中国兵器工业集团第二一四研究所苏州研发中心 Manchester code converting method on MIC bus
US8350734B1 (en) * 2008-12-10 2013-01-08 Ess Technology, Inc. Method and apparatus for digital to analog conversion of data stream with random and low-frequency periodic jitter
CN103676933A (en) * 2013-11-21 2014-03-26 上海申通地铁集团有限公司 MVB (multifunction vehicle bus) analysis device
CN103795680A (en) * 2012-10-29 2014-05-14 苏州工业园区新宏博通讯科技有限公司 Communication method supporting multiple communication protocols, and electric energy meter
CN104301521A (en) * 2014-09-17 2015-01-21 浙江铭众生物医学创业投资有限公司 Modulation mode and communication circuit based on mobile phone audio interface and communication method of communication circuit based on mobile phone audio interface
CN104486030A (en) * 2014-11-19 2015-04-01 中国科学院自动化研究所 Rocket projectile collinear loading and setting communication system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7970260B2 (en) * 2001-06-27 2011-06-28 Verizon Business Global Llc Digital media asset management system and method for supporting multiple users

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728713A (en) * 2004-07-27 2006-02-01 邓里文 Method for transmtitig digital video
CN1842069A (en) * 2005-03-31 2006-10-04 欧姆龙株式会社 Received data compensating device
CN101184030A (en) * 2007-11-06 2008-05-21 浙江工业大学 FPGA based Ethernet interface drive set
US8350734B1 (en) * 2008-12-10 2013-01-08 Ess Technology, Inc. Method and apparatus for digital to analog conversion of data stream with random and low-frequency periodic jitter
CN101478466A (en) * 2009-01-16 2009-07-08 中国北车股份有限公司大连电力牵引研发中心 MVB analogue signal input module based on FPGA
CN102098131A (en) * 2009-12-15 2011-06-15 航天科工惯性技术有限公司 Dynamic parameter configuration-based general framing and de-framing method for serial port data frames
CN102103701A (en) * 2009-12-16 2011-06-22 索尼公司 Signal processing apparatus and signal processing method
CN102045334A (en) * 2010-09-27 2011-05-04 北京泰豪智能工程有限公司 Protocol conversion method and device
CN101976074A (en) * 2010-11-03 2011-02-16 浙江工业大学 Industrial control system based on field bus and control network
CN102170326A (en) * 2011-03-23 2011-08-31 武汉华中数控股份有限公司 Serial communication method of position measuring equipment and device thereof
CN102394655A (en) * 2011-10-31 2012-03-28 中国兵器工业集团第二一四研究所苏州研发中心 Manchester code converting method on MIC bus
CN103795680A (en) * 2012-10-29 2014-05-14 苏州工业园区新宏博通讯科技有限公司 Communication method supporting multiple communication protocols, and electric energy meter
CN103676933A (en) * 2013-11-21 2014-03-26 上海申通地铁集团有限公司 MVB (multifunction vehicle bus) analysis device
CN104301521A (en) * 2014-09-17 2015-01-21 浙江铭众生物医学创业投资有限公司 Modulation mode and communication circuit based on mobile phone audio interface and communication method of communication circuit based on mobile phone audio interface
CN104486030A (en) * 2014-11-19 2015-04-01 中国科学院自动化研究所 Rocket projectile collinear loading and setting communication system and method

Also Published As

Publication number Publication date
CN106982199A (en) 2017-07-25

Similar Documents

Publication Publication Date Title
CN103141066B (en) Transmission circuit, reception circuit, transmission method, reception method, communication system and communication method therefor
CN103957056B (en) The visible light communication system of compatible smart mobile phone
CN100545882C (en) The self-adaptive decoding method that is used for wireless remote control receiving chip
CN106817197B (en) Communication coding and decoding method based on duty ratio modulation
CN106982199B (en) Manchester code communication protocol self-adaption method based on FPGA and CPLD
CN101702639A (en) Check value calculation method and device of cyclic redundancy check
CN100385427C (en) Communication controller and method of transforming information
CN103036641A (en) Method and system of data exchange and deserialization method
CN104717036B (en) A kind of Difference Manchester decoding circuit and decoding system
CN106448128B (en) Infrared remote control data processing method and system
JPH0685823A (en) Method and apparatus for transmission of data on serial link
US9621388B2 (en) Method for serial data transmission and system therefor
CN102364947B (en) Multipath IP video coding card based on PCIe bridge
CN112823496B (en) Frame masking unit, subscriber station for a serial bus system and method for communication in a serial bus system
CN110875911B (en) Communication protocol and communication method for supporting automatic identification of single data packet data bit number
CN113438052B (en) Signal decoding method, device, electronic equipment and storage medium
CN113259395B (en) Data communication device and method in embedded environment
CN103023610A (en) Data transmission method and apparatus of 485 interface
JPH10322404A (en) Serial data communication method and system
CN108551366B (en) Visible light communication method based on LED and mobile phone camera
CN105303808A (en) Photoelectric direct reading meter multicast protocol self-adapting method and system
CN111800637A (en) System and method for realizing HDB3 encoding and decoding by using FPGA
JP5204851B2 (en) Data transmission method
CN104202124A (en) Erp (enterprise resource planning) data package communication method
US20190020743A1 (en) Data transmitting apparatus, data receiving apparatus and method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant