ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Interface converter GPIB-RS-232 Encyclopedia of radio electronics and electrical engineering / Measuring technology Many modern measuring instruments are equipped with the IEEE488 interface, which is known in the West as GPIB (General Purpose Interface Bus), and in Russia as CPC (general use channel according to GOST 26.003-80). It allows you to combine devices into automated measuring systems. But to control such a complex, you need a computer equipped with an adapter for this interface. In the typical configuration of most personal computers, it is not available, and as an independent product it is not cheap. The proposed device will make it possible to use a standard computer COM port to control the public channel and exchange information over it. First of all, you need to understand the basic principles of the GPIB interface. Its organization can be compared to the activities of any commission: the chairman decides which of the members of the commission speaks and which listens. Accordingly, devices operating in three modes are connected to the public channel to the common bus: controller (controller), speaker (talker) and listener (listener). The listener only receives information. Up to 14 listeners are allowed at the same time. The speaker is allowed to transmit information. Only one speaker is allowed at a time. The controller (controller) combines the functions of a listener and a speaker, and in addition, it is able to address all other devices. The complex of devices connected by the GPIB bus should include only one controller. All devices are connected in parallel via 16 signal lines and eight common wire lines. Negative logic is used: low signal level - log. 1 (true), high level - log. 0 (false). The signal lines are divided into three groups: information, byte transmission synchronization and interface control. Information lines DIO1-DIO8 (LD0-LD7) form an eight-bit two-way data bus. Typically, information is transmitted in text form using the seven-digit ASCII code (American Standard Code for Information Interchange) or its domestic equivalent KOI-7. For example, to transmit the number 123, the ASCII codes for the digits 1 (0110001), 2 (0110010), and 3 (0110011) are transmitted in turn. Interface commands, addresses and device control commands are also transmitted via the data bus.
There are three synchronization lines in total. A low level on the DAV (Data Valid) or SD (Data Synchronization) line is set by the speaker only if the information output by him to the data bus is reliable, and the listener received a signal of readiness to accept it - a high level on the NRFD (Not Ready) line For Data) or GP (Ready to Receive). A low level (log. 1) on this line means not ready to receive. Since the NRFD signal outputs of all devices are open-collector and connected in parallel, there will be no high level here until at least one listener is ready to receive.
Similarly, a high level on the NDAC (Not Data Accepted) or DP (Data Accepted) line indicates that the listener has successfully received the information. As with the NRFD line, a high level on the NDAC line is not possible until all listeners have set it. Byte transfer cycle timing diagrams are shown in fig. 1, where the following characteristic moments of time are noted: T_1 - all listeners are ready to receive a byte;
Table 1
Each of the devices connected by a shared channel is assigned a unique address. To address a specific device, the controller transmits its address in command mode (when the ATN line is low). The address occupies the least significant five bits of a byte and can be in the range 0-30, the value 31 is reserved for general interface commands. Any device equipped with a GPIB interface has facilities for setting and changing its address, such as five removable jumpers on the rear panel. By bits DIO6 and DIO7 of the address byte, the controller sets the functional purpose of the device. When low on the DIO6 line, this is the listener, and on the DIO7 line, it is the speaker.
The diagram of the GPIB to RS-232 interface converter developed by the author is shown in fig. 2. An alternating or constant supply voltage of any polarity is supplied to connector X1. The diode bridge VD1 rectifies it or leads to the desired polarity, and the integral stabilizer brings it to the value of 5 V required to power the microcircuits. Socket X2 is connected to the plug of one of the computer's COM ports. Chip DA1 matches the signal levels of the RS-232 interface with those received and generated by the microcontroller DD1. The value of the frequency of the quartz resonator ZQ1 indicated in the diagram provides an accurate setting of the standard speed of information exchange with the computer. High load capacity on the GPIB interface data bus (DIO1 - DIO8) is provided by the DD2 bidirectional transceiver chip. If you need to connect more than five or six devices to a public channel, you may have to amplify the signals on the other interface lines as well. The HL1 LED indicates the ongoing exchange of information with devices connected to the public channel, and HL2 indicates the presence of the converter supply voltage. The HZ plug is designed for programming the DD1 microcontroller, already installed on the converter board. If it is pre-programmed with a programmer, this connector is not needed. The microcontroller configuration must be set as follows: extended (extended) byte - OxFF, high (high) byte - OxDF, low (low) byte - OxDE. X4 socket - RPM7-24G-PB-V, standard for GPIB interface (KOP). The location and purpose of its contacts are shown in fig. 3. The SB 1 button is used to restart the microcontroller after a program failure.
The appearance of the converter assembled on the breadboard is shown in fig. 4. After assembly, it should be connected to a computer and run any terminal program. I used the RS232 Pro program. The connection parameters must be: baud rate 115200, no parity, one table digit. The converter performs the functions of a shared access channel controller, executing the commands given in Table 232 via RS-2. XNUMX. Each of them consists of two characters - an identifier and a parameter. The symbol $, for example, identifies a group of one-time commands. The character (number) following it selects a specific command from this group. The identifier # means that the ASCII code of the character accompanying it must be transmitted over the GPIB interface. Command $6 initiates parallel polling of multiple fixtures. It is usually issued after the controller receives a service request (SRQ=1) to determine which fixture needs attention. To signal this, each of them is assigned a certain bit of the data bus (DIO). This is done using removable jumpers on the instrument panel or by PPC (Parallel Poll Configure - Parallel Poll Configuration) interface commands issued by the controller. After the initialization of parallel polling, it is only necessary to read the state of the DIO7-DIO1 lines with the help of the $8 command and analyze it. Serial polling is slower than parallel polling, but determines the reason for the request more accurately. To start it, you need the SPE (Serial Poll Enable) interface command. After it, each device addressed as a speaker will transmit its status byte. For a complete list of interface commands, see the "Tutorial Description of the Hewlett-Packard Interface Bus" document, which can be found online at vt100.net/manx/details/7,17449 Note that not all GPIB-equipped devices are required to execute certain common interface commands. Using the available in table. 2 commands, you can perform any operations on the GPIB bus, which gives the user the opportunity to independently write a computer program for servicing a particular device or their system. To illustrate this possibility, the author wrote the GPIB Terminal program.
Having launched this program, it is necessary, having opened the one shown in Fig. 5 the "Settings" tab, specify the number of the COM port to which the converter is connected, and the GPIB address of the device to work with, set the characters that indicate the end of the message line during transmission and reception. At the end of the settings, click on the "Apply and save" screen button. Successful opening of the port will be indicated by the inscription "Port is open" on the "Received data" panel of the "Terminal" tab. On fig. Figure 6 shows an example of the instrument's response to the *idn? - request for the name of the manufacturer, type and other information about the device. It should be noted that the responses of the device to the commands sent to it are not always provided. Often, having received a command, the device executes it (for example, switches to the required mode of operation) "silently", without informing the controller about it.
For a visual study of the process of information exchange over a public channel, the program provides the one shown in Fig. 7 tab "Teams". Let's try to send the command *idn? the means available here. First of all, the device must be addressed as a listener with address 2. To do this, send the address byte with the value 0x22 hexadecimal or 34 decimal.
By pressing the screen button ATN set ATN=1 (low level on the line of the same name). Note that after each operation, the current state of the control lines is automatically displayed at the bottom of the tab. Enter the address in the format corresponding to the marked item of the "Format" field in the input field next to the "Send" screen button and click on this button. Set ATN=0 by depressing the corresponding button. Entering the required values and pressing the "Send" button, we transmit the following sequence of bytes: 0x2A, 0x69, 0x64, 0x0E, 3x0f^ 0x0D, 0x13A. Note that by checking the "ASCII" item, you can enter not hexadecimal codes, but the characters themselves that form the command. However, the Carriage Return (OxOD) and Line Feed (OxOA) characters that terminate it must still be entered in hexadecimal or decimal (respectively 10 and XNUMX) format. Next, we address the device as a speaker, for which we press the ATN button, then dial and transmit the address 0x42 or 66. Immediately after releasing the ATN button, we receive the device's response by pressing the "Read" screen button to receive each character. Note that when the last character of the response is received, EO1=1 will be set. Having learned how to work with the GPIB interface at a low level and having programming skills, you can begin to develop programs for controlling measuring systems. The interface converter microcontroller program and the computer program described in the article can be downloaded hence. Author: M. Terentiev, Ulyanovsk; Publication: radioradar.net See other articles Section Measuring technology. Read and write useful comments on this article. Latest news of science and technology, new electronics: The world's tallest astronomical observatory opened
04.05.2024 Controlling objects using air currents
04.05.2024 Purebred dogs get sick no more often than purebred dogs
03.05.2024
Other interesting news: ▪ SGA power adapters up to 60W ▪ Hearing aid for ornithologist ▪ Metal foam - thermal insulator ▪ Bacteria in space are becoming more resistant to antibiotics News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ section of the site Calls and audio simulators. Article selection ▪ article Zeus the Thunderer. Popular expression ▪ article What is in the US area, the area code of which is 321? Detailed answer ▪ article by Timyan Marshallov. Legends, cultivation, methods of application ▪ article Charger Tourist. Encyclopedia of radio electronics and electrical engineering
Leave your comment on this article: Comments on the article: Sergei Help me write a diploma on this converter. I want more information. All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |