4
HTBasic GPI B Tutorial This tutorial describes the IEEE-488, HP-IB or GPIB instrumentation bus. Bus History IEEE-488 Overview System Controller and Active Controller Listeners, Talkers and Controllers Interface Signals Data Lines Handshake Lines Handshaking Interface Management Lines Device Addresses Physical Characteristics Summary Bus History The IEEE-488 bus was developed to connect and control programmable instruments, and to provide a standard interface for communication between instruments from different sources. Hewlett-Packard originally developed the interfacing technique, and called it HP-IB. The interface quickly gained popularity in the computer industry. Because the interface was so versatile, the IEEE committee renamed it GPIB (General Purpose interface Bus). IEEE-488 Overview Almost any instrument can be used with the IEEE-488 specification, because it says nothing about the function of the instrument itself, or about the form of the instrument’s data. Instead the specification defines a separate component, the interface, that can be added to the instrument. The signals passing into the interface from the IEEE-488 bus and from the instrument are defined in the standard. The instrument does not have complete control over the interface. Often the bus controller tells the interface what to do. The Active Controller performs the bus control functions for all the bus instruments. System Controller and Active Controller At power-up time, the IEEE-488 interface that is programmed to be the System Controller becomes the Active Controller in charge. The System Controller has several unique capabilities including the ability to send Interface Clear (IFC) and Remote Enable (REN) commands. IFC clears all device interfaces and returns control to the System Controller. REN allows devices to respond to bus data once they are addressed to listen. The System Controller may optionally Pass Control to another controller, which then becomes Active Controller. Listeners, Talkers and Controllers There are 3 types of devices that can be connected to the IEEE-488 bus (Listeners, Talkers, and Controllers). Some devices include more than one of these functions. The standard allows a maximum of 15 devices to be connected on the same bus. A minimum system consists of one Controller and one Talker or Listener device (i.e., an HP 700 with an IEEE-488 interface and a voltmeter).

GPIB

Embed Size (px)

DESCRIPTION

GPIB

Citation preview

Page 1: GPIB

HTBasic GPI B Tutorial

This tutorial describes the IEEE-488, HP- IB or GPIB inst rum entat ion bus.

Bus History I EEE-488 Overview System Cont roller and Act ive Cont roller Listeners, Talkers and Cont rollers I nterface Signals Data Lines Handshake Lines Handshaking Interface Managem ent Lines Device Addresses Physical Characterist ics Sum m ary

Bus History The I EEE-488 bus was developed to connect and cont rol program m able inst rum ents, and to provide a standard interface for com m unicat ion between inst rum ents from different sources. Hewlet t -Packard originally developed the interfacing technique, and called it HP- IB. The interface quickly gained popularit y in the com puter indust ry. Because the interface was so versat ile, the IEEE com m it tee renam ed it GPIB (General Purpose interface Bus) .

I EEE- 4 8 8 Overview Alm ost any inst rum ent can be used with the I EEE-488 specificat ion, because it says nothing about the funct ion of the inst rum ent it self, or about the form of the inst rum ent ’s data. I nstead the specificat ion defines a separate com ponent , the interface, that can be added to the inst rum ent . The signals passing into the interface from the I EEE-488 bus and from the inst rum ent are defined in the standard. The inst rum ent does not have com plete cont rol over the interface. Often the bus cont roller tells the interface what to do. The Act ive Cont roller perform s the bus cont rol funct ions for all the bus inst rum ents.

System Controller and Act ive Controller At power-up t im e, the I EEE-488 interface that is program m ed to be the System Cont roller becom es the Act ive Cont roller in charge. The System Cont roller has several unique capabilit ies including the abilit y to send Interface Clear ( IFC) and Rem ote Enable (REN) com m ands. IFC clears all device interfaces and returns cont rol to the System Cont roller. REN allows devices to respond to bus data once they are addressed to listen. The System Cont roller m ay opt ionally Pass Cont rol to another cont roller, which then becom es Act ive Cont roller.

Listeners, Talkers and Controllers There are 3 types of devices that can be connected to the I EEE-488 bus (Listeners, Talkers, and Cont rollers) . Som e devices include m ore than one of these funct ions. The standard allows a m axim um of 15 devices to be connected on the sam e bus. A m inimum system consists of one Cont roller and one Talker or Listener device ( i.e. , an HP 700 with an IEEE-488 interface and a voltm eter) .

Page 2: GPIB

I t is possible to have several Cont rollers on the bus but only one m ay be act ive at any given t im e. The Act ive Cont roller m ay pass cont rol to another cont roller which in turn can pass it back or on to another cont roller. A Listener is a device that can receive data from the bus when inst ructed by the cont roller and a Talker t ransm its data on to the bus when inst ructed. The Cont roller can set up a talker and a group of listeners so that it is possible to send data between groups of devices as well.

I nterface Signals The I EEE-488 interface system consists of 16 signal lines and 8 ground lines. The 16 signal lines are divided into 3 groups (8 data lines, 3 handshake lines, and 5 interface m anagem ent lines) .

Data Lines The lines DI O1 through DI O8 are used to t ransfer addresses, cont rol inform at ion and data. The form ats for addresses and cont rol bytes are defined by the I EEE 488 standard. Data form ats are undefined and m ay be ASCI I (with or without parity) or binary. DI O1 is the Least Significant Bit (note that this will correspond to bit 0 on m ost com puters) .

Handshake Lines The three handshake lines (NRFD, NDAC, DAV) cont rol the t ransfer of m essage bytes am ong the devices and form the m ethod for acknowledging the t ransfer of data. This handshaking process guarantees that the bytes on the data lines are sent and received without any t ransm ission errors and is one of the unique features of the I EEE-488 bus.

The NRFD (Not Ready for Data) handshake line is asserted by a Listener to indicate it is not yet ready for the next data or cont rol byte. Note that the Cont roller will not see NRFD released ( i.e., ready for data) unt il all devices have released it .

The NDAC (Not Data Accepted) handshake line is asserted by a Listener to indicate it has not yet accepted the data or cont rol byte on the data lines. Note that the Cont roller will not see NDAC released ( i.e., data accepted) unt il all devices have released it .

The DAV (Data Valid) handshake line is asserted by the Talker t o indicate that a data or cont rol byte has been placed on the data lines and has had the m inim um specified stabilizing t im e. The byte can now be safely accepted by the devices.

Handshaking The handshaking process is out lined as follows. When the Cont roller or a Talker wishes to t ransm it data on the bus, it sets the DAV line high (data not valid) , and checks to see that the NRFD and NDAC lines are both low, and then it puts the data on the data lines.

When all the devices that can receive the data are ready, each releases it s NRFD (not ready for data) line. When the last receiver releases NRFD, and it goes high, the Cont roller or Talker takes DAV low indicat ing that valid data is now on the bus.

Page 3: GPIB

I n response each receiver takes NRFD low again to indicate it is busy and releases NDAC (not data accepted) when it has received the data. When the last receiver has accepted the data, NDAC will go high and the Cont roller or Talker can set DAV high again to t ransm it the next byte of data.

Note that if after set t ing the DAV line high, the Cont roller or Talker senses that both NRFD and NDAC are high, an error will occur. Also if any device fails to perform its part of the handshake and releases either NDAC or NRFD, data cannot be t ransm it ted over the bus. Eventually a t im eout error will be generated.

The speed of the data t ransfer is cont rolled by the response of the slowest device on the bus, for this reason it is difficult to est im ate data t ransfer rates on the IEEE-488 bus as they are always device dependent .

I nterface Managem ent Lines The five interface m anagem ent lines (ATN, EOI , IFC, REN, SRQ) m anage the flow of cont rol and data bytes across the interface.

The ATN (At tent ion) signal is asserted by the Cont roller to indicate that it is placing an address or cont rol byte on the data bus. ATN is released to allow the assigned Talker t o place status or data on the data bus. The Cont roller regains cont rol by reassert ing ATN; this is norm ally done synchronously with the handshake to avoid confusion between cont rol and data bytes.

The EOI (End or I dent ify) signal has two uses. A Talker m ay assert EOI sim ultaneously with the last byte of data to indicate end-of-data. The Cont roller m ay assert EOI along with ATN to init iate a parallel poll. Although m any devices do not use parallel poll, all devices should use EOI to end t ransfers (m any current ly available ones do not ) .

The IFC ( Interface Clear) signal is asserted only by the System Cont roller in order to init ialize all device interfaces to a known state. After releasing IFC, the System Cont roller is the Act ive Cont roller.

The REN (Rem ote Enable) signal is asserted only by the System Cont roller. I t s assert ion does not place devices into rem ote cont rol m ode; REN only enables a device to go into rem ote m ode when addressed to listen. When in rem ote m ode, a device should ignore it s local front panel cont rols.

The SRQ (Service Request ) line is like an interrupt : it m ay be asserted by any device to request the Cont roller to take som e act ion. The Cont roller m ust determ ine which device is assert ing SRQ by conduct ing a serial poll. The request ing device releases SRQ when it is polled.

Device Addresses The I EEE-488 standard allows up to 15 devices to be interconnected on one bus. Each device is assigned a unique prim ary address, ranging from 0-30, by set t ing the address switches on the device. A secondary address m ay also be specified,ranging

Page 4: GPIB

from 0-30. See the device docum entat ion for m ore inform at ion on how to set the device prim ary and opt ional secondary address.

Physical Characterist ics You can link devices in either a linear, star or com binat ion configurat ion using a shielded 24-conductor cable. The standard I EEE-488 cable has both a plug and receptacle connector on both ends. This connector is the Am phenol CHAMP or Cinch Series 57 MICRO RIBBON type. Special adapters and non-standard cables are available for special interconnect applicat ions.

The I EEE-488 bus specifies a m axim um total cable length of 20 m eters with no m ore than 20 devices connected to the bus and at least two- thirds of the devices powered on. A m axim um separat ion of 4 m eters between devices and an average separat ion of 2 m eters over the full bus should be followed. Bus extenders and expanders are available to overcom e these system lim its.

The bus uses standard TTL level negat ive logic. When NRFD is t rue for exam ple it is a TTL low level, and when NRFD is false, it is a TTL high level.

Sum m ary The I EEE-488.1 standard great ly sim plified the interconnect ion of program m able inst rum ents by clearly defining m echanical, hardware, and elect r ical protocol specificat ions. For the first t im e, inst rum ents from different m anufactures were connected by a standard cable. This standard does not address data form ats, status report ing, m essage exchange protocol, com m on configurat ion com m ands, or device specific com m ands.

The I EEE-488.2 standard enhances and st rengthens the I EEE-488.1 standard by specifying data form ats, status report ing, error handling, cont roller funct ionalit y, and com m on inst rum ents com m ands. I t focuses m ainly on the software protocol issues and thus m aintains com pat ibilit y with the hardware- oriented IEEE-488.1 standard. I EEE-488.2 system s tend to be m ore com pat ible and reliable.