Design of Multi-channel HDLC Transceiver Circuit Based on FPGA

Publisher:liliukanLatest update time:2009-12-10 Source: 西安电子科技大学Keywords:FPGA Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The HDLC (High Level Date Link Control) protocol is one of the most widely used protocols in the field of communications. It is a bit-oriented high-level data link control procedure with powerful error detection, high efficiency and synchronous transmission. There are many dedicated HDLC chips on the market, but most of these chips have complex control and a limited number of channels. On the other hand, the use of dedicated chips will effectively increase the PCB area, which is not conducive to the miniaturization of equipment and brings high costs and other problems.

FPGA can process signals of any data width, and the internal functional modules can be processed in parallel. Therefore, the use of FPGA technology to design the HDLC protocol controller can balance the load of the entire system, realize a multi-channel high-performance HDLC protocol controller, and ensure the reliability of communication. At the same time, it also has the advantages of short design and development cycle, low design and manufacturing cost, and real-time online inspection, so it is widely used in special chip design. In this design, Altera's EP2C70F672C8 chip is used to implement the HDLC protocol controller.

1 Introduction to HDLC Protocol

In the HDLC communication mode, all information is transmitted in the form of frames. The HDLC frame format is shown in Table 1.

HDLC frame format

(1)Sign word.

The HDLC protocol stipulates that all information transmission must start with a flag word and end with the same flag word, which is 01111110. The start flag and the end flag constitute a complete information unit, called a frame. The receiver can detect the start and end of the frame by searching for 01111110 to establish frame synchronization. In the idle period between frames, flag words can be sent continuously to fill.

(2) Information segment and “0” bit insertion technology.

The information length of the HDLC frame is variable, and any binary information other than the flag word can be transmitted. In order to ensure that the flag word is unique, the sender uses the "0" bit insertion technology when sending information, that is, when the sender sends all information except the flag character (including the check bit), as long as it encounters 5 consecutive "1", it automatically inserts a "0"; conversely, when the receiver receives data, as long as it encounters 5 consecutive "1", it automatically deletes the subsequent "0". The "0" bit insertion and deletion technology also makes HDLC have good transmission transparency, and any bit code can be transmitted.

(3) Address segment and control segment.

The address field is 8 bits and can be extended in multiples of 8 to identify the stack address that receives the frame. The control field is 8 bits and the sender's control field is used to indicate the category and function of commands and responses.

(4) Frame check.

HDLC uses 16-bit cyclic redundancy check code (CRC-16) for error control. Its generating polynomial is x16+x12+x5+1. Error checking refers to the CRC cyclic redundancy check of the content of the entire frame, that is, the error code within the error correction range is corrected, and the error code within the error correction range is checked, but cannot be corrected. The flag bit and all "0" inserted according to the transparent rule are not within the range of verification.

2 FPGA Implementation of HDLC Protocol

In order to ensure that the remote control and telemetry platform meets the mission requirements of high-speed communication, multi-channel reception and transmission, and easy functional expansion and configuration, the central controller adopts an integrated design with a high-performance ARM7 as the CPU data processing core and an FPGA-designed serial communication controller to transmit and receive multi-channel HDLC data.

Multi-channel HDLC block diagram

FPGA receives and stores digital quantities from 8 independent channels such as integrated processors according to the HDLC protocol. The system first converts the external input HDLC data stream from RS485 electrical characteristics to TTL level. In this process, optocouplers are used for isolation to avoid mutual interference with external devices, and the power supply of RS485 chip and optocoupler devices uses independent 5 V and 5 V ground supplied by electricity. The overall structure block diagram of HDLC protocol is shown in Figure 2. Each control module consists of functional modules such as clock control, encoding/collision detection, transmission and reception FIFO. In the transmission direction and reception direction, there is a 128-bit FIFO for data buffering between the serial channel and the CPU bus interface. Transmission is the reverse process of reception. Here, HDLC data reception is used as an example to illustrate.

HDLC protocol overall structure diagram

The principle of FPGA serial communication controller receiving HDLC data is as follows: first, the message field and the additional status field of the received data frame are moved in, and then the destination address in the received frame is identified according to the selected addressing mode to confirm whether the sending address of the data frame is the device (station address = 77H). If it is the data frame of the device, the data is received and stored in the FIFO. When the receiving data frame is finished, an interrupt signal is sent to the ARM system to request to receive HDLC data. [page]

The data frame whose destination address is not this device will be discarded. The flow chart is shown in Figure 3.

flow chart

3 Experimental Results and Analysis

First, a pair of HDLC data transceiver circuits are implemented in FPGA, and the transceiver circuits are simulated and tested. By generating relevant data files as the data source of HDLC in the Matlab development environment, directly calling them in the test file of ModelSim SE 6.1, and finally comparing the simulation results with the data source generated by Matlab, satisfactory results can be obtained. The test code coverage of the simulation is 100%, and the simulation results and the data source are completely consistent, which can confirm the correctness and good reliability of the circuit. Figure 4 and Figure 5 are the simulation diagrams of the HDLC data transceiver module in ModelSim SE 6.1.

Simulation diagram of HDLC data transceiver module in ModelSim SE 6.1

In order to rationally utilize the logic resources inside the FPGA, a series of layout and routing constraints are imposed on the design: (1) From the previous demonstration, it can be seen that the design contradiction is mainly concentrated on the resource consumption. The optimization target of all modules is positioned as "Area". Except for FIFO, other modules are planned together; (2) FIFO is divided into independent modules; (3) The global clock is bound to the Global resource, and the derived clocks in the parallel/serial and serial/parallel modules are set as multi-cycle paths according to the relationship with the global clock.

The stability and reliability of actual data transmission and reception are also related to the board, temperature, etc. After the simulation is completed, the board is wired, the specific transceiver circuit is electrically connected, and the loopback test method is performed, that is, the data output by the transmitter is received by the receiver for testing. At room temperature, after 30 hours of long-term operation test, the received and sent data were compared, and no packet loss or error was found. From the test results, it can be seen that the HDLC transceiver circuit is stable and reliable. High and low temperature experiments were not carried out due to limited conditions. The temperature characteristics of the board can be roughly inferred from the temperature characteristics of the device, which will not be discussed here.

4 Conclusion

Aiming at the requirements of a remote control and telemetry platform, this paper proposes a multi-channel HDLC transceiver circuit design based on FPGA, and uses Altera's P2C70F672C8 chip to implement it. At present, the board that implements the circuit has been debugged and successfully applied to the whole machine test. Practice shows that the circuit has the advantages of simple implementation, high reliability, and flexible use, and has certain promotion value.

Keywords:FPGA Reference address:Design of Multi-channel HDLC Transceiver Circuit Based on FPGA

Previous article:A digital watermarking algorithm based on the robustness of DWT-DCT transform
Next article:Design of wireless communication transceiver module based on FPGA

Recommended ReadingLatest update time:2024-11-16 21:03

Design and implementation of a multi-channel micro-injection pump
Micro-injection pump is an instrument for long-term micro-injection, which is often used in clinical medicine and life science research. This instrument is mainly used for arteriovenous infusion, blood transfusion and precision chemical experiments. The main problem of micro-injection pumps at home and abroad today
[Medical Electronics]
Design and implementation of a multi-channel micro-injection pump
Design of hardware abstraction layer for FPGA based on SCA specification
introduction Software Radio refers to a radio communication system that is defined by software and can realize multiple functions. Its core idea is to construct an open, standardized, and modular universal hardware platform to complete various functions (such as working frequency band, modulation and demodu
[Embedded]
Design of hardware abstraction layer for FPGA based on SCA specification
Communication between STM32 spi and FPGA
I've been studying the SPI bus recently, so I won't go into details about the protocol and hardware description. The four lines include clock, chip select, receive, and send initialization.   SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; //Full-duplex   SPI_InitStructure.SPI_Mode = SPI_Mode_Maste
[Microcontroller]
Silicon Witchery Releases Development Board Integrating Nordic SoC and Lattice FPGA
Swedish embedded module supplier Silicon Witchery has released a very compact module, the S1, designed to connect a Nordic Semi nRF52840 to the most space-constrained projects, which also integrates a Lattice iCE40 field-programmable gate array (FPGA). “Designed for efficient AI on the smallest edge devic
[Embedded]
Silicon Witchery Releases Development Board Integrating Nordic SoC and Lattice FPGA
Design of a large LED screen control system based on MCU+FPGA
If you take a look at the current market, you will find that most small and medium-sized LED display systems use traditional single-chip microcomputers as the main control chip. However, single-chip microcomputers with less internal resources and slower running speeds are difficult to meet the needs of large-screen
[Power Management]
Design of a large LED screen control system based on MCU+FPGA
Frequency Hopping Radio Transmission System Based on FPGA+DSP
introduction Frequency hopping technology is a spread spectrum technology with high anti-interference and anti-interception capabilities. The receiving system is a very important part of the frequency hopping communication system. Adaptive frequency hopping technology, high-speed frequency hopping technology, channel
[Embedded]
Frequency Hopping Radio Transmission System Based on FPGA+DSP
High-speed transient signal detection system based on FPGA and DSP
introduction At present, there is an urgent need for a method and means to monitor the firing process of electric pyrotechnics in real time without loss, and to make accurate judgments and certifications on the reliability of pyrotechnics based on the monitoring results, so as to solve specific problems in
[Test Measurement]
High-speed transient signal detection system based on FPGA and DSP
Implementation of Modbus communication protocol based on Picoblaze core of FPGA
0 Introduction At present, according to the sales data released by major FPGA manufacturers, Xilinx's FPGA market share accounts for nearly 50%. The device density of the Spartan-3E series ranges from 100,000 to 1.6 million system gates. Its unit logic unit cost is the lowest in the FPGA industry. It can realiz
[Microcontroller]
Implementation of Modbus communication protocol based on Picoblaze core of FPGA
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号