Research on the HART protocol of the instrument

Source: Internet
Author: User

In the past, we learned a lot about the HART protocol. We know that it has important applications in bus and some specific occasions. Here, we mainly take a look at the meter application of the HART protocol. Here, we focus on the Design of Remote Communication hardware, hoping to help you expand your knowledge in this area.

Design of Remote Communication hardware for field meter HART Protocol

The HART protocol of a field meter mainly converts digital signals to analog current signals, access to the main variables and measurement, process parameters, device configuration, calibration and diagnostic information is also implemented. The HART communication part is mainly implemented by the D/A conversion and Bell202 MODEM and its ancillary circuits., d/A is used to directly convert A digital signal to 4mA ~ 20mA current output to output the main variable. The role of the Bell202 MODEM and its ancillary circuit is to overlay the current in 4mA ~ After the signal on the 20mA loop is 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". The MCU communicates with the MCU through the serial port to receive the command frame and process the corresponding data. Then, the MCU generates the response frame to be sent back, 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, the digital signal is superimposed on the loop by the AD421 。

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, using 16-pin DIP, TSSOP, SOIC encapsulation, it can realize low-cost Remote Intelligent Industrial Control. AD421 includes serial input 16-bit D/A (digital/current) conversion, in addition to its own electricity, it also provides optional (5 V, 3.3 V or 3 V) Voltage Regulator output for other parts 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, the chip is integrated with the following components: the tuner, modem, clock, timing circuit, and detection and control circuit complying with the BELL202 standard. The 16-foot DIP and 28-foot PLCC encapsulation are cost-effective, when the power supply is 5 V, the operating current is 80 μA. HT2012 exchange digital signals with the microcontroller and uses the analog signal interface with AD421. On the one hand, HT2012 performs serial communication with the asynchronous serial communication port of MCU, on the one hand, the input non-return digital signal is modulated into a PSK signal, and then superimposed on the 4mA ~ through the AD421 ~ 20mA of the return signal, or filter the loop signal through the band-pass, zoom in and shaping the system, and then retrieve the '2's signal and demodulated it into a digital signal to implement HART communication 。

For the input clock required by the hart modem, use the 7.3728MHz crystal oscillator to divide the clock by 4 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 software design of the entire field instrument 。

During HART communication, the host (host computer) sends a command frame. After the on-site instrument receives the command frame through a serial port interruption, the MCU processes the 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, clear the communication buffer, and enable the interrupt 。

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 then enters the receiving part. Then, the host command is interpreted and corresponding operations are performed according to the Command. Finally, the response frame is generated in a certain format and sent to the communication buffer zone to start sending, close SCI after completion 。

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 work, 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 time in the future, HART protocol products 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.