National Instruments GPIB-COM Switch User Manual


 
Section Five Programming the GPIB-COM
© National Instruments Corporation 5-17 GPIB-COM User Manual
The GPIB-COM Controller Function
Because most serial port applications involve communication with only one serial line, the GPIB-
COM imposes some restrictions on the GPIB in order to be compatible with existing serial port
software. The GPIB-COM must be System Controller of the GPIB and will not work with other
Controllers. The behavior of the GPIB-COM depends on the setting of the talk-only jumper.
If the jumper is set to talk-only, the GPIB-COM assumes that there is a listen-only device
connected to the GPIB. When a byte is written into the Transmitter Holding Register, the GPIB-
COM sets the THRE bit of the Line Status Register to 0, puts the contents of that register on the
GPIB data lines, and begins the source handshake sequence. When the Listener releases NDAC*,
the THRE bit is set back to 1 and the GPIB-COM waits for another byte to be written into the
Transmitter Holding Register.
If the jumper is set to talk/listen, the GPIB-COM assumes that the device connected to the GPIB
can be addressed to listen or talk. When the computer is powered on, the GPIB-COM sends the
talk address that is set on the DIP switches, addresses itself as a Listener, and unasserts NRFD*.
If the GPIB device sends a byte, the GPIB-COM accepts it, stores it in the Receive Buffer
Register, and sets the DR bit of the Line Status Register. At the end of the GPIB handshake, it
keeps NRFD* asserted until the computer reads the byte from the Receive Buffer Register.
If the computer writes a byte to the Transmitter Holding Register, the GPIB-COM sends the GPIB
device its listen address from the DIP switches and addresses itself to talk. Then it sends the byte
to the GPIB device, which is now addressed as a Listener. When the GPIB-COM begins a source
handshake, it starts a 200-msec timer. If the source handshake is completed before the 200 msec
is expired, the GPIB-COM remains addressed to talk until the timer runs out. If the computer
writes another byte before the timer runs out, the GPIB-COM restarts the timer and sends the byte.
When 200 msec has passed since the last byte was written, the GPIB-COM sends the talk address
and addresses itself to listen again. If a byte was waiting in the Receive Buffer Register when the
computer wrote to the Transmitter Holding Register, the GPIB-COM remembers this and when it
becomes a Listener again, it asserts NRFD* until the computer reads the byte from the Receive
Buffer Register.