Share this

Development of an economical instrument interface module based on PROFIBUS-DP bus

2026-04-06 06:08:05 · · #1
Abstract: Because of the communication transform problem between traditional field instruments and FCS, an economical Profibus-DP communication transform interface module using Sunplus SPCE061A microprocessor and Siemens SPC3 protocol chip was designed in the paper. The schematic of main circuit and flowchart of software were given. Keywords : PROFIBUS-DP bus; Interface Module; Sunplus Single-chip Microcomputer 0 Introduction PROFIBUS (abbreviation of Process Fieldbus) is an international, open fieldbus standard that is independent of equipment manufacturers [1]. According to the application field, it is divided into three compatible parts: PROFIBUS-FMS, PA, and DP. Among them, DP is used for device-level and field-level manufacturing automation. The technology is relatively mature, with a wide range of applications and strong versatility [2]. At present, some large foreign instrument manufacturers (such as the well-known SIEMENS, AEG, ABB, etc.) have launched their own PROFIBUS-DP fieldbus control systems and corresponding fieldbus products. Their DP development technology is quite mature, and their products sell very well. However, these achievements mainly come from the market share of PLC systems, while the application of DP technology in fieldbus intelligent instrument level still needs to be improved. At present, my country started late in PROFIBUS-DP technology research and DP product development. Some automation companies and research institutes mainly focus on system integration and engineering applications, based on SIEMENS' PLC system, with the help of mature development package technology, or directly using the DP underlying equipment and intelligent instruments provided by foreign companies to build their own control systems. The disadvantage of doing so is that the development cost is high and the system lacks flexibility. In order to reduce costs and minimize the constraints and limitations imposed by DP developers on technology, we adopt the design idea of ​​overall retention and partial modification to develop economical bus instruments with PROFIBUS-DP interfaces. Design a local DP system that meets user needs based on the structural characteristics of the new DP system; according to DP technical specifications and user requirements, use a relatively economical development model to equip existing field instruments with communication interfaces that can access the DP network, thereby transforming the existing instruments into bus instruments. 1 Hardware Design of Bus Instrument Interface Module The hardware structure of the economical bus instrument is relatively simple, mainly consisting of a traditional instrument and a PROFIBUS-DP interface module. If the interface module is placed inside the traditional instrument, the instrument casing needs to be redesigned; if placed separately, only the DP interface module needs to be designed. The hardware design of this interface adopts a modular design mode, namely, two parts: microcontroller control and isolated drive circuits. The following uses a common voltmeter as an example to describe the design process of the DP interface. 1.1 Microcontroller Control Circuit In a DP system, there are usually multiple master stations and slave stations. This slave station refers to the bus instrument with a DP interface. Its economy is mainly reflected in the interface design: the control circuit uses the Lingyang 61 development board. It already includes the minimum system and peripheral expansion circuits, is small in size, relatively inexpensive, and has relatively complete functions. SPCE061A is its core microcontroller, a 16-bit μ'nSPTM microprocessor; it has 2K words of static memory (SRAM) and 32K words of flash memory (FLASH); 32 general-purpose I/O ports; one 10-bit ADC (analog-to-digital converter) mic-in input channel, with built-in microphone amplifier and automatic gain control (AGC) function; seven 10-bit ADC (analog-to-digital converter) line-in input channels; two 10-bit DAC (digital-to-analog converter) output channels; watchdog function; and programmable audio processing [3]. The microcontroller exchanges data with the outside world through its 32 general-purpose I/O ports. The protocol chip SPC3 is its extended external RAM. The connection diagram between it and the SPC3 pin is shown in Figure 1. [align=center] Figure 1 Schematic diagram of SPCE061A and SPC3 connection Figure 2 Schematic diagram of SPC3 pin expansion[/align] 1.2 DP protocol chip SPC3 SPC3 is a user-specific integrated circuit chip developed and manufactured by Siemens for developing DP intelligent slave stations. It conforms to the EN50170 standard and integrates the complete PROFIBUS-DP protocol[4]. The expansion method of its 44 pins in the DP interface design is shown in Figure 2. 1.3 Isolation drive circuit The circuit structure of this part is similar to the circuit structure recommended in the SPC3 manual, but the isolation chip used is one 6N137 and two HCPL7721. In the experimental stage, it is more convenient to use through-hole chips than surface-mount chips. The internal working principle is briefly described below. The XCTS pin of SPC3 is to clear the transmit signal. When it is "1", it means clearing the transmit signal; when it is "0", it means enabling the transmit. The SPC3's RTS pin is the request-to-transmit signal, corresponding to the 4-pin RS-485; the SPC3's TXD pin is the serial transmit port, and the RXD pin is the serial receive port, corresponding to the 3-pin and 8-pin RS-485 respectively. The first path is the request-to-transmit signal, so it has a separate trace. When a high level is sent to pin A of the 6N137, a low level is output from pin VO; after passing through a 74HC132 NAND gate, it becomes high; this signal is sent to the DE pin of the SN75ALS176. The second and third paths are transmit/receive signals, so their traces are reversed. When the SPC3's TXD outputs a high level, it is sent to pin VI of the HCPL7721, whose VO pin outputs a high level, and then sent to pin D of the 75176. At this time, pin A of the 75176 outputs a high level, and pin B outputs a low level. The principle when the bus sends a signal to the SPC3 is similar and will not be described further. 2. Software Design The hardware composition of the DP interface is relatively simple, which brings certain difficulties to the software design. Because the only chip with communication capabilities in the hardware is the SPC3, which integrates the entire DP protocol, but the second-layer software functions and management need to be implemented by the user through software, software design is both the key and the challenge. We adopted a modular design approach to make the overall structure compact, clear, and easy to debug and modify. The software development environment is the IDE that comes with the Sunplus 61 development board. 2.1 SPC3 Initialization The SPC3 integrates 1.5KB of dual-port RAM, with addresses from 000H to 5FFH. The internal RAM is divided into 192 segments, each consisting of 8 bytes. The RAM space can be functionally divided into three areas: the processor parameter area, the organization parameter area, and the DP buffer. SPC3 initialization involves assigning values ​​to the corresponding addresses of the internal registers after power-on. These values ​​depend on the specific settings made by the user for each bit of the parameter area address. [align=center] Figure 3 SPC3 Initialization Program Flowchart Figure 4 DP Interface Main Program Flowchart[/align] 2.2 Main Program and Interrupt Handling Program Design The main tasks of the SPCE061A are initializing and starting the SPC3, acquiring data and displaying values, sending and receiving data, and handling external interrupts according to the master station's requirements. When the host computer or master station sends a command to the fieldbus instrument, the DP interface of this instrument must respond. At this time, the main program will jump to the interrupt program to handle these sudden events. The external interrupt program specifically includes: handling new global control commands, new parameter messages, new I/O configurations, new addresses, watchdog timeouts, user clocks, and polling baud rates, etc. 2.3 SPC3 Register Read/Write Function Test After the overall software development is completed, a test program needs to be written to verify the previous design work. The Sunplus 61 development board exchanges data with the SPC3 internal registers only through 32 I/O ports. The initialization of the SPC3 is a process of continuously writing data into its registers. The programming feature of the software development environment IDE is that communication data must first be sent or received through the I/O port, and the changes in the general-purpose registers can be seen in its development interface. Therefore, an important indicator for judging whether the DP interface can communicate is whether the microcontroller can read and write the data of the SPC3 internal register. [align=center] Figure 5 Flowchart of the test program for data exchange between SPCE061A and SPC3 internal registers[/align] 3 Writing the GSD file The PROFIBUS-DP master station can exchange data with various DP slave stations (from simple I/O slave stations to complex intelligent slave stations). In order to safely and conveniently identify the many types of DP slave stations, it is necessary to obtain the technical characteristic data of the slave station. The file describing this data is called the Device Description Data file (GSD) [5]. The GSD file starts with the identifier "#Profibus_DP". Each sentence starts with a keyword that conforms to the PROFIBUS GSD file standard. It is not case-sensitive. The semicolon is followed by a comment statement. PROFIBUS-DP intelligent slaves only include some basic functions of DP slave devices, such as the baud rate supported by the slave, the length of the exchanged input/output data, and the type of the slave [6]. The following is part of the content of writing the slave GSD file. #Profibus_DP ;Unit-Definition-List: GSD_Revision =2 ;GSD format identifier version number Model_Name =“SPC3_intelligent_slave” ;Module name (controller type) Protocol_Ident =0 ;Protocol used by DP device: PROFIBUS-DP Station_Type =0 ;DP device type, slave... 9.6_supp =1 ;Supported baud rate 9.6Kbit/s... MaxTxdr_9.6 =60 ;Maximum latency (response) time at 9.6Kbit/s... ;Slave-Specification: OrderNumber =“SPC3_intelligent_slave” ;Product order number Implementation_Type =“SPC3 solution” ;Use chip SPC3 to develop DP slave Max_User_Prm_Data_Len =5 ;Maximum user parameter data length Set_Slave_Add_supp =0 ;Slave address cannot be set Modular_Station =0 Compact Slave... Module-Definition-List: Module = "8 Byte in, 8 Byte out" ;I/O Configuration Data EndModule 4 Conclusion The Lingyang 61 development board offers high cost-effectiveness and stability. Using the Lingyang microcontroller and SPC3 protocol chip in DP bus instruments simplifies and compacts the hardware circuitry, significantly reducing development costs and accelerating the development process. Through software debugging, the basic functions of the intelligent slave station have been implemented. However, adding this interface to a voltmeter would increase its size. Therefore, to develop an aesthetically pleasing and economical bus voltmeter with independent intellectual property rights, an embedded DP interface needs to be designed based on traditional instruments. This interface should be integrated into both the field instrument and the upstream control device, resulting in a compact and cost-effective DP system with excellent market application prospects. The author's innovations include: abandoning the currently popular DP product development kits and bus bridge technologies, and using the cost-effective Lingyang 61 development board as the DP interface development platform; designing a DP bus interface for traditional instruments from an economic perspective and transforming them into economical bus instruments; thereby reducing the overall cost of the DP system and giving it broader application prospects. Project economic benefits: If the field layer of a small PROFIBUS-DP control system is divided into 10 segments, with 30 slave stations in each segment, then it is estimated that the above design scheme will save approximately RMB 250,000 compared to the development kit design scheme, approximately RMB 350,000 compared to the embedded design scheme, and approximately RMB 600,000 compared to directly using foreign DP instruments. References [1] Li Zhengjun. Fieldbus and its application technology. First edition. Beijing: Machinery Industry Press, 2005. [2] Yang Xianhui. Fieldbus technology and its application. Beijing: Tsinghua University Press, 1999. [3] Luo Yafei et al. Application basics of Lingyang 16-bit single-chip microcomputer. First edition. Beijing: Beijing University of Aeronautics and Astronautics Press, 2005. [4] SIEMENS AG. SPC3 Siemens PROFIBUS Controller User Description. Germany: the Fed. Rep. of Germany, 2002. [5] Xia Jiqiang, Xing Chunxiang. First edition. Beijing: Beijing University of Aeronautics and Astronautics Press, 2005. [6] SIEMENS AG. PROFIBUS-DP Device Description Data Files GSD. Version: 2.2. Germany: Certification Center of Germany, 2003. [7] Li Xiaodong, Sun Hexu, Yun Lijun, Liang Tao. Application of PROFIBUS-DP in Networked Process Control Systems. Microcomputer Information (Measurement and Control Automation), 2005, 21(5), 22-23
Read next

CATDOLL 115CM Mimi TPE

Height: 115cm Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22