Interfaces
An interface is some hardware, and possibly also some software, that is used to connect two devices or systems to enable them to communicate. An interface may have to:
1- Control and check the data being transmitted.
2- Convert data from one form or one code to another.
3- Allow for a difference in speed between two devices.
Examples of interfaces
1- A modem is an interface between a remote computer terminal and the telephone system.
2- When a person uses a computer the keyboard and the program are both part of the interface between the user and the computer.
3- To convert a certain computer to use floppy discs a ‘disc interface’ is fitted. This consists of a specially designed integrated circuit ‘chip’ inside the computer and a connector on the back.
Example of an interfacing problem
A particular computer is to be interfaced to a printer of another make. The problems are:
1- The printer has been set up to receive a parallel transmission, but it is to be connected to a serial port on the computer.
2- The computer is to be used for word processing. The control characters it sends out to produce underlining, bold printing, etc. are different from those used by the printer.
The interface between the two consists of:
1 A serial interface circuit board fitted to the printer so that it will receive a serial transmission.
2 A new serial lead to connect the printer to the computer.
3 A ‘printer driver’ program in the computer to convert the control characters to the right codes for the printer.
COMPUTERS AS INTERFACES
A computer can itself be used as an interface between two systems. The computer has a conversion program running in it continuously. It accepts data from one system, converts it and outputs it to the other system.
Examples of the use of computers as interfaces
1 A front-end processor. This is a small computer which inputs and outputs all the data for a large computer. It organizes the data so that the main computer has a simpler processing task. (Compare this with a multiplexor- which does a similar job but a simpler one. A front-end processor deals with a variety of fast input and output devices.)
2 A microprocessor in a peripheral. Many peripherals such as printers and disc units now contain their own processors.
Advantages of having a microprocessor in a peripheral
1 Control characters sent from the computer can be used to change the way the peripheral operates-for example a printer can be sent a command to print using a different character set.
2 The main computer saves storage and processing time because the peripheral can organize the data itself.
Advantages of using a computer as an interface
1 If one of the interfaced systems is changed, the conversion program can easily be changed. 2 It is often cheaper to use a general-purpose computer than to make a different interface for each task.
BUFFERS
A buffer is a store in the interface between two devices which temporarily stores data which is being transmitted from one to the other. The buffer is necessary if the two devices work at different speeds. The commonest use of a buffer is at the interface between the central processor of a computer and a peripheral (Fig 6).
Example of the use of a buffer
A central processor is sending data to a printer. The central processor sends enough data to fill the printer’s buffer. The central processor can then get on with something else while the printer prints the data in the buffer. When the printer has printed all the data it sends a signal to the central processor that it is ready to receive more data.
Fig. 6 A printer interfaced to a computer
Double buffering
Double buffering is the use of two buffers at the interface between two devices instead of just one. One device can then be emptying the first buffer at the same time as the other device is filling the second one.
ANALOGUE INPUT AND OUTPUT
Although most computers are now digital, many output and input devices are analogue (for definition of analogue see introduction ).
Examples of analogue input and output devices
1 A joystick usually produces two voltages. One of these is a measure of the movement of the stick from left to right. The other is proportional to the movement of the stick up and down.
2 The BBC Buggy (see photograph ) has a light sensor which measures how much light is falling on it.
Note: This should be contrasted with a wand or light pen for reading bar codes . The wand is digital as it only registers whether light is hitting it or not.
3 a A music synthesizer attached to a computer may be made to produce sounds using a steadily changing voltage from the computer.
4 The heating, watering and ventilation of a greenhouse can be controlled by a microprocessor. To control ventilation, the computer sends out a varying voltage. The vents are opened by a distance proportional to this voltage.
Conversion between digital and analogue signals
if a digital computer accepts input from an analogue device then an analogue-to-digital (A-to-D) converter is required.
An A-to-D converter is an interface to convert an analogue signal to a digital one (Fig 7). Usually an A-to-D converter consists of an integrated circuit which inputs a voltage. It outputs a set of two-state signals. These represent a binary number which is roughly proportional to the input voltage.
Fig 7 An analogue-to-digital converter in use
If a digital computer outputs to an analogue device then a digital-to-analogue (D-to-A) converter is required.
A digital-to-analogue converter is an interface to convert a digital signal to an analogue one (Fig 8). It converts a set of binary signals to one single varying voltage.
Fig 8 A digital-to-analogue converter in use