Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Interface converter GPIB-RS-232

Free technical library

Encyclopedia of radio electronics and electrical engineering / Measuring technology

Comments on the article Comments on the article

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.
The clock lines coordinate the transfer of eight-bit bytes over the data bus. Due to the interaction of the speaker with the listener or listeners, if there are several of them, on these lines, the transmission speed is selected automatically, based on the capabilities of the active participants in the exchange. Thus, it is possible to connect devices with different speeds by a common channel. Devices that do not participate in the exchange remain passive.

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.

Interface converter GPIB-RS-232
Fig. 1

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;
T0 - the speaker reports that he has sent a byte to the data bus;
T1 - the listener has started receiving and processing a byte and reports that it is not yet ready to receive the next one;
T2 - the listener received a byte;
T3 - the speaker reports that the byte on the data bus is no longer valid;
T4 - the listener removes the receive complete signal in preparation for the next cycle;
T5, T6 - similar to T-1, and To of the previous cycle.
The five interface control lines are designed to tell those connected to the public channel what actions to take, what mode to be in, and how to respond to commands. Detailed information about the purpose of these lines contains table. one.

Table 1

control line Description
GPIB KOP
ATN (Attention) UE (Management) High level - a byte of information is transmitted. Low - control byte will move
IFC (Interface Clear) SI (Reset Interface) Low level - immediately stop any interface operations, all devices go to the initial state
SRQ (Service Request) 30 (Service Request) A high level usually indicates that there is information to send or that an error has occurred. On this signal, the controller starts polling all devices to find out the reason for its appearance and perform the required actions.
REN (Remote Enable) DU (Remote Control) High level - autonomous operation of the device. Low level - the device is controlled remotely by interface commands
EOI (End Of Identify) KP (End of Transfer) Low - The last byte of the message is transmitted. Simultaneous pulling low on the ATN and EOI lines initiates parallel polling of devices

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.

Interface converter GPIB-RS-232
Fig. 2

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.

Interface converter GPIB-RS-232
Fig. 3

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.

Interface converter GPIB-RS-232

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.

Interface converter GPIB-RS-232

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.

Interface converter GPIB-RS-232
Fig. 5

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.

Interface converter GPIB-RS-232
Fig. 6

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.

Interface converter GPIB-RS-232
Fig. 7

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.

<< Back

Latest news of science and technology, new electronics:

The world's tallest astronomical observatory opened 04.05.2024

Exploring space and its mysteries is a task that attracts the attention of astronomers from all over the world. In the fresh air of the high mountains, far from city light pollution, the stars and planets reveal their secrets with greater clarity. A new page is opening in the history of astronomy with the opening of the world's highest astronomical observatory - the Atacama Observatory of the University of Tokyo. The Atacama Observatory, located at an altitude of 5640 meters above sea level, opens up new opportunities for astronomers in the study of space. This site has become the highest location for a ground-based telescope, providing researchers with a unique tool for studying infrared waves in the Universe. Although the high altitude location provides clearer skies and less interference from the atmosphere, building an observatory on a high mountain poses enormous difficulties and challenges. However, despite the difficulties, the new observatory opens up broad research prospects for astronomers. ... >>

Controlling objects using air currents 04.05.2024

The development of robotics continues to open up new prospects for us in the field of automation and control of various objects. Recently, Finnish scientists presented an innovative approach to controlling humanoid robots using air currents. This method promises to revolutionize the way objects are manipulated and open new horizons in the field of robotics. The idea of ​​controlling objects using air currents is not new, but until recently, implementing such concepts remained a challenge. Finnish researchers have developed an innovative method that allows robots to manipulate objects using special air jets as "air fingers". The air flow control algorithm, developed by a team of specialists, is based on a thorough study of the movement of objects in the air flow. The air jet control system, carried out using special motors, allows you to direct objects without resorting to physical ... >>

Purebred dogs get sick no more often than purebred dogs 03.05.2024

Caring for the health of our pets is an important aspect of the life of every dog ​​owner. However, there is a common assumption that purebred dogs are more susceptible to diseases compared to mixed dogs. New research led by researchers at the Texas School of Veterinary Medicine and Biomedical Sciences brings new perspective to this question. A study conducted by the Dog Aging Project (DAP) of more than 27 companion dogs found that purebred and mixed dogs were generally equally likely to experience various diseases. Although some breeds may be more susceptible to certain diseases, the overall diagnosis rate is virtually the same between both groups. The Dog Aging Project's chief veterinarian, Dr. Keith Creevy, notes that there are several well-known diseases that are more common in certain breeds of dogs, which supports the notion that purebred dogs are more susceptible to disease. ... >>

Random news from the Archive

Sharing scents with mobile phones 27.11.2002

The Scottish company "Electronic Aromas" is developing a new technology that will help mobile phone subscribers to share scents.

Phones will be equipped with special cassettes with a standard set of flavors, the combination of which imitates the required smells. The codes of this or that aroma will be transmitted over the radio channel and initiate the corresponding smells on the receiving side.

Other interesting news:

▪ SGA power adapters up to 60W

▪ Strawberry snacks

▪ 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 Entertaining experiments: get acquainted with the diode. Encyclopedia of radio electronics and electrical engineering

▪ article Charger Tourist. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:




Comments on the article:

Sergei
Help me write a diploma on this converter. I want more information. [lol]


All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024