Hardware and software design of HART Protocol

Source: Internet
Author: User

For the basic concepts of the HART protocol, refer to the previous two articles "Notice for beginners of the HART protocol" and "Analysis of the application level of the HART protocol". Next, we will give a detailed introduction to the specific application of the HART protocol.

Design of Remote Communication hardware for field meter HART Protocol

The HART protocol of a field meter converts digital signals to analog current signals, and accesses the main variables and measurements, process parameters, equipment configuration, calibration, and diagnosis information. The HART communication part is mainly implemented by the D/A conversion and the Bell202 MODEM and its ancillary circuits. The function of D/A transformation is to directly convert the digital signal to 4mA ~ 20mA current output to output main variables. The role of the Bell202 MODEM and its ancillary circuits is to overlay ~ After the signal on the 20mA loop is filtered and amplified by band-pass filtering, if the HART communication unit detects the Frequency Shift Keying Signal, The Bell202 MODEM decrypts the frequency Hz signal to "1 ", the 2200Hz digital signal is demodulated to "0". It communicates with the MCU through a serial port, and the MCU receives command frames for corresponding data processing. Then, the MCU generates the response frame to be sent back, and the digital signal of the response frame is modulated by the MODEM into the corresponding frequency Hz and 2200Hz Frequency Shift Keying signals. After waveform shaping, after AD421 is superimposed on the loop.

The D/A converter uses AD421, which is A single-chip high-performance digital-to-analog converter launched by the American ADI company. It is powered by A loop, and 16-bit digital signals are input in serial mode, the digital signal can be directly converted to 4mA ~ 20mA current output. It provides high-precision, fully integrated, and low-power solutions. It uses 16-pin DIP, TSSOP, and SOIC packages to implement low-cost Remote Intelligent Industrial Control. AD421 includes A serial input of 16-bit D/A digital/current) conversion, in addition to its own power supply, but also provides an optional 5 V, 3.3 V or 3 V) the voltage regulator output is used by other components of the transmitter.

Hart modem adopts Smar's HT2012, which is a half-duplex MODEM compliant with the Bell202 standard and implements the coding or decoding of digital communication as stipulated in the HART protocol. This chip is designed for HART instruments. It is integrated with the following components: A tuner, a modem, a clock, a timing circuit, and a detection and control circuit that complies with the BELL202 standard. High Cost Performance, 16-foot DIP and 28-foot PLCC encapsulation, working current 80 μA when + 5 V power supply. HT2012 exchanges digital signals with the microcontroller and uses AD421 as the analog signal interface. On the one hand, it performs serial communication with the asynchronous serial communication port of the MCU, on the other hand, it modulated the input non-return digital signal into a base-B signal, and then superimposed on the base of 4mA ~ through the AD421 ~ 20mA of the return signal, or filter the loop signal through the band-pass filter, zoom in and shaping the system, and then retrieve the '2's signal and demodulated it into a digital signal, so as to implement HART communication.

For the input clock required by the hart modem, use the 7.3728MHz crystal oscillator to divide the clock by four times through two counters 74LS161.

Due to the requirements of HART digital communication, a 5mA sine wave current signal is superimposed on 4mA current. Therefore, the entire hardware circuit must work properly at 5mA or less, therefore, it is very important to design low power consumption of the system.

Communication Software Design

The HART communication program is the software implementation of the data link layer and application layer of the HART protocol. It is the key to the design of the entire field instrument software.

In the HART communication process, the host machine sends command frames. After the on-site instrument receives the command frame through a serial port interruption, the MCU processes the corresponding data and generates a response frame, the MCU triggers sending interruption and sends a response frame to complete a command exchange.

First, after power-on or the watchdog is reset, the main program initializes the communication part, including the baud rate setting, serial port working mode setting, clearing the communication buffer zone, and opening and stopping.

After the initialization is complete, the communication part is always in the ready-to-receive State. Once a command is sent from the host computer, the OCD of the HT2012 carrier detection port changes to a low level, which triggers interruption and starts receiving, the program enters the receiving part. Then, complete the host command explanation and execute corresponding operations according to the command. Finally, generate a response frame in a certain format and send it to the communication buffer zone. Then, start sending and close SCI.

After sending the response frame, wait for the next host command again.

Summary

Practice has proved that the above method has the characteristics of simple structure and reliable operation. It fully complies with the HART protocol and has good versatility.

Thanks to the many unquestionable advantages of HART, it has become the world's most widely used field communication protocol and has become a practical industrial standard. Therefore, for a long period of time in the future, HART protocol products will still have a very broad market in China.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.