To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
There are two styles of hardware for using a microcomputer to acquire data and control equipment. One is exemplified by the IBM-PC system you have used in the laboratory. The ADC, the DAC and the digital I/O cards are inside the computer and are under direct control of the microprocessor. They have control and data registers which are directly addressable via the buss. External devices (sensors, switches, etc) are connected to the cards. Creative programming can turn the computer into, for example, an oscilloscope (ADC and display) or a signal generator (DAC) as the laboratory exercises have shown.
Other buss systems are in use which, like the slots in the IBM-PC, allow a microprocessor to be connected to various data acquisition and control devices by simple board replacements. Some of the more widely used ones are S100, STDBUS, MULTIBUS, and QBUS.
The second style is to have a separate box next to the computer which has the ADCs, DACs, digital I/O lines and a programmed microprocessor controller. It communicates with the computer via a serial or parallel communication system (Section 9.2 has a description of a parallel system). The box takes care of the data acquisition and control while the computer is used to send control bytes to tell the box what to do and to receive the data for further processing. The limitation of this style is in the speed of communication to the computer and in the number of things the box has been preprogrammed to know how to do.
The microprocessor has become commonplace in our technological society. Everything from dish washers to astronomical telescopes have chips controlling their operation. While the development of applications for computers has been in constant flux since their introduction, the principles of computer operation and of their use in sensing and control have remained stable. Those are the primary subjects of this book. Once a basic understanding of the principles has been built, further detailed knowledge can be acquired later as the need arises.
This book is designed to be accompanied by extensive laboratory work. Over the years the engineering curriculum has focused more and more on the lecture/recitation format. This has led to an ever increasing emphasis on theoretical developments and a loss of contact with the physical basis of engineering and science. The laboratory provides a vital experience in linking theory with physical reality. It also provides the satisfaction of building something and making it work.
Not all computers are suitable for laboratory use. Large mainframe computers are fast and can handle large amounts of data but are awkward to connect to laboratory equipment. At the other end of the scale, microprocessors are included in many laboratory devices but are programmed to perform only a restricted set of duties. Mini and microcomputers have enough speed and memory for all but the most demanding applications but yet are small enough to be dedicated to individual projects and therefore are widely used in the laboratory.
With the technological strides of recent years, microcomputers (or personal computers) have prodigious capabilities.
This device is commonly called a UART (Universal Asynchronous Receiver/Transmitter). There is one for each COM port of the computer. They allow communication between computers directly or via telephone modems.
Asynchronous Communications Adapter
The Asynchronous Communications Adapter is a 4“H × 5”W card that plugs into a System Expansion Slot. All system control signals and voltage requirements are provided through a 2 × 31 position card edge tab. A jumper module is provided to select either RS-232-C or current loop operation.
The adapter is fully programmable and supports asynchronous communications only. It will add and remove start bits, stop bits, and parity bits. A programmable baud rate generator allows operation from 50 baud to 9600 baud. Five, six, seven or eight bit characters with 1, 1–1/2, or 2 stop bits are supported. A fully prioritized interrupt system controls transmit, receive, error, line status and data set interrupts. Diagnostic capabilities provide loopback functions of transmit/receive and input/output signals.
Figure (22) is a block diagram of the Asynchronous Communications Adapter.
The heart of the adapter is a INS8250 LSI chip or functional equivalent. The following is a summary of the 8250's key features:
Adds or Delete Standard Asynchronous Communication Bits (Start, Stop, and Parity) to or from Serial Data Stream.
Full Double Buffering Eliminates Need for Precise Synchronization.
Independently Controlled Transmit, Receive, Line Status, and Data Set Interrupts.
Programmable Baud Rate Generator Allows Division of Any Input Clock by 1 to (216–1) and Generates the Internal 16× Clock.
The purpose of an instrument is to make measurements of a particular parameter in a physical process. This requires at least a sensor which responds to the parameter and a display which lets the user record readings which are in some way proportional to the parameter being measured. A thermometer is an instrument which indicates the temperature by quantitatively showing the expansion of a liquid with a temperature increase. A more complete description of the measurement process is shown in Figure 2.1. The arrows show possible but not necessary routes for the flow of information. The computer is able to do many of the tasks which were formerly done by separate units of an instrument. This lets the designer reduce the number of components required to a bare minimum as the experiments in this book show. Many times all that is needed is a sensor to translate the process into an electrical signal.
Another way to think of the computer is as an interface between the experimenter and the experiment (or the user and the measurement). It is able to translate the unintelligible signals from the sensor into a form which is understandable using human senses. One of the best ways of communicating information is by picture. ‘A picture is worth a thousand words.’ (In fact, it takes roughly a thousand words of computer memory to display a video graphics screen.)
To use apparatus intelligently it helps to understand what is going on inside; the discussion below focuses on giving some insight into what occurs when you do an analog conversion. As with most things, such discussion has many layers of increasing depth and detail. This discussion will go only one veneer down.
The analog to digital conversion is done on the John Bell Engineering Universal I/O board by an ADC 0817 IC which is connected to the address and data busses and to the RD (read) and WR (write) wires of the IBM-PC (Figure D.I). Port addresses 812–819 (assuming a base address of 800 decimal) are devoted to operation of the ADC.
There are basically three operations which can be done. Refer to Figure D. 1 in the following. If a byte is written to any of the port addresses 812–815 (e.g., Port[812]: = n;), the address is decoded by the card circuitry and the CS4 wire is activated. The WR wire is also active since this is a write operation. Thus the data wires (D0–3) at positions ABCD on the multiplexer are activated. These four wires select by means of a binary code, the position of the switch so that one of 16 analog input channels is connected to the input of the converter section. Thus the lower four binary digits of the byte (n) are used to set the multiplexer channel number. Just after the multiplexer is switched, the converter is started since the WR and CS4 wires are also connected to the Start input of the converter section.
Interrupts are an important capability of modern computers. They allow the processing of several independent tasks by the CPU. On large computers they allow multiuser and time sharing activities. On microprocessors they allow the running of a main program while periodically taking data or sending data to a slow device like a printer. Also computer start up, the keyboard, and TOD functions make use of the interrupt function.
In the discussion which follows, we will first trace the steps taken by the CPU when it receives an Interrupt Request (INTR) from other parts of the computer and then look into the ways we can cause interrupts to be generated and serviced.
Interrupts and the CPU
The interrupt sequence is similar to a jump to a subroutine except that it occurs when signalled by a wire leading to the CPU (INTR). When an interrupt signal is present on the INTR wire and the interrupt enable bit (IF) of the Flag register (see Figure 8.1) is 1, the CPU begins processing the interrupt. The interrupt enable bit is used to prevent the CPU from beginning to process the same interrupt again before it has completed the first one. Without it the computer would go into a continuous regression. The IF bit is set equal to 0 during an interrupt sequence and further interrupts are ignored until this bit is returned to 1. This can be done with the SEI instruction but is done automatically at the return from the interrupt service routine.
Thus far, there has been no need to understand the inner workings of the computer in order to do useful experiments. It has been a black box which responds in a reliable way when given instructions. Just as in using a car, many times this is sufficient; however, to utilize its capabilities as a tool in the laboratory fully, the internal operation of the computer should be understood. In this chapter, we will look under the hood to explore the internal organization of the IBM-PC and to learn to program the 8088 microprocessor directly.
Inside the IBM-PC
A first glance under the cover of the IBM-PC shows a circuit board with a row of connectors which contain other circuit boards standing vertically. The horizontal board (the mother board) contains the 8088 microprocessor chip and various other chips which control the keyboard and screen and contain the memory cells. The microprocessor is the CPU which controls the system and executes the program instructions. The boards in the connectors perform a variety of other functions. Figure 6.1 shows the general organization.
The different chips and circuit boards communicate with each other via the buss: a group of 62 wires which carry digital signals. There are 20 address lines, 8 data lines, and 34 auxiliary lines. The data lines contain the 8 bits of data which are to be transferred by the CPU. The bits on the address lines specify the binary number of the location from or to which the data will be transferred. The operation of the computer is, at the lowest level, a controlled transfer and manipulation of bits of data among various chips and devices.
A solid body moving through a fluid has a force pushing on it which depends on the type of fluid. You might imagine that it would be much harder to swim in honey than it is in water. The parameter which describes this difference is the viscosity (μ). The drag force also depends upon other parameters such as the surface area of the body and the fluid density, as you will discover in this chapter. The computer will be programmed to measure the speed of a sphere falling through glycerine and to calculate the viscosity. The measurements are made with photosensors and using machine language programming.
Force required to move a solid body through a fluid
In this section the physics of a sphere moving in a fluid will be discussed. There are two distinct regimes; if the sphere is moving slowly, the dominant force resisting its motion is due to viscosity. For rapid movement, the inertial resistance of the fluid due to its density is the dominant factor. The magnitude of the resistance and the functional dependence on sphere size, velocity, fluid density and viscosity can be estimated in a rough way for both cases. This gives insight into how the drag force behaves without getting lost in the mathematics. Indeed, with turbulent phenomena exact computations have not been possible.
Viscous resistance of a fluid arises from shear in the velocity profile of flow. If two flat plates have fluid between them, as shown in Figure 7.1, a force is required to move the top one at a constant speed in relation to the bottom one.
In addition to Turbo Pascal, a graphing program is needed which is capable of drawing engineering graphs on the screen and the printer. There are several ways to do this. One is to use the primitive graphics functions of Turbo Pascal itself to build a library of graphing procedures. This has the advantage of making the graphics functions available in the program generating the data but is a much larger task than it initially appears to be. The Turbo Graphics Toolbox available from Borland International provides some plotting features, but generally it concentrates on graphics rather than graphing which limits its usefulness.
Using a spread sheet program is another way of graphing data. It has the advantage of also allowing the data to be transformed before graphing. However, the graph formats are frequently limited (eg, a single set of abscissa values and no logarithmic scales) and a file of the data must be written before it is used.
There are a number of stand alone graphing programs on the market now which can make beautiful graphs. Some of them allow data manipulation as well. Please see the list of programs which follows.
A wish: Someone please make an engineering graphing program (memory resident?) which can be used from within a program to make quick graphs on the screen or printer of data and models.