This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
INTERFACING OF ANALOG SIGNALS TO MICROCONTROLLERS
It is well-known that we live in an analog world.Virtually, all information we need to acquire from the human body and eventually analyze is in the analog form i.e. the signals consist of many waveforms that continuously vary as a function of time. Examples include electromyograph, pressure signals and pulse waveforms.
For interfacing analog signals to microprocessors/microcomputers, use is made of some kind of data acquisition system. The function of this system is to acquire and digitize data, often from hostile clinical environments, without degradation in the resolution or accuracy of the signal. Since software costs generally far exceed the hardware costs, the analog/digital interface structure must permit software effective transfers of data and command and status signals to avail of the full capability of the microprocessor.
The analog interface system, in general, handles signals in the form of voltages. The physical parameters such as temperature, flow, pressure, etc. are converted to voltages by means of transducers. The choice and selection of appropriate transducers is very important, since the data can only be as accurate as the transducer.
A block diagram of a universal interface circuit for connecting analog signals to microprocessors. It basically comprises a multiplexer, instrumentation (buffer) amplifier, a sample-and-hold circuit, analog-to-digital converter (ADC), tristate drivers and control logic. These components operate under the control of interface logic that automatically maintains the correct order of events.
The function of the multiplexer is to select under address control, an analog input channel and connected to the buffer amplifier. The number of channels is usually 8 or 16.Depending on its input configuration, the multiplexer will handle either single ended or differential signals.
The address logic of most multiplexers can perform both random and sequential channel selection. For real time systems, the random mode permits the multiplexer to select any channel when the program responds to a peripheral service request. Sequential channel selection, as the name implies involves addressing each channel in order.
7.2 Buffer Amplifier:
The buffer amplifier conditions the selected input signal to a suitable level for application to the A/D Converter. Driven by the multiplexer, the buffer amplifier, which is usually an instrumentation amplifier, provides impedance buffering, signal gain and common mode rejection. It has high input impedance, 100Mohms or more to reduce the effects of any signal distortion caused by the multiplexer. The high input impedance also minimizes errors due to the finite on-resistance of the multiplexer channel switches.
To improve system sensitivity, the amplifier boosts the input signal .If it is required to have analog signals of differing ranges, connected to the multiplexer input, then a programmable gain amplifier would be preferable where the gain would be set in accordance with the multiplexer selection address. The use of programmable gain amplifiers removes the necessity to standardize on the analog input ranges.
7.3 Sample and Hold Circuit:
The A/D converter requires a finite time for the conversion process, during which time the analog signal will still be hanging according to its frequency components. It is therefore necessary to sample the amplitude of the input signal, and hold this value on the input to the A/D converter during the conversion process. The sample and Hold circuit freezes its output on receipt of a command from the control circuit, thereby providing an essentially constant voltage to the A/D converter throughout the conversion cycle.
The sample hold is essentially important in systems having resolution of 12-bits or greater, or in applications in which real time inputs are changing rapidly during a conversion of the sampled value. On the other hand, a sample hold may not be required in applications where input variation is low compared to the conversion time.
7.4 A/D Converter:
The A/D converter carries out the process of the analog-to-digital conversion. It is a member of the family of action/status devices which have two control lines-the start conversion or action input line and the end of conversion or status output line.
An A/D converter is a single chip integrated circuit having a single input connection for the analog signal and multiple pins for digital output. It may have 8, 12, 16 or even more output pins, each representing an output bit. The higher the number of bits, the higher the precision of conversion. Each step represents a change in the analog signal:8-bits gives 256 steps,12-bits provides 4096 steps and we get 32768 steps with 16 output bits.
The key parameters in A/D converters are:
- Resolution of the A/D Converter is a measure of the number of discrete digital code that it can handle and is expressed as number of bits(binary).For example, for an 8-bit converter, the resolution is 1-part in 256.
- Accuracy is expressed as either a percentage of full scale or alternatively in bits of resolution. For example, a converter may be termed 12-bit accurate if its error is 1 part in 4096.The sources of error contributing to the inaccuracy of a converter or linearly, gain, error and offset error.
- Integral non-linearity is a measure of the deviation of the transfer function from a straight line
- Off-set error is a measure of the difference of the analog value from the ideal at a code of all zeroes.
- Gain Error represents the difference in slope of the transfer function from the ideal.
- Speed of an A/D converter is generally expressed as its conversion time,i.e. the time elapsed between application of a convert command and the availability of data at its outputs. The speed of D/A converter is measured by its settling time for a full scale digital input change.
Each of the above parameters is temperature-dependent and they are usually defined at 25° C.
7.5 Tri-state Drivers:
The tri-state drivers provide the necessary isolation of the A/D converter output data from the microprocessor data bus and are available as 8-line units.Thus,for the 10 or 12 bit converters, two drivers would be required which would be enabled by two different read addresses derived from the address decoder.
Some A/D converters have in-built tri-state drivers.However, because of their limited drive capability; they can be used only on lightly loaded buses. For heavily loaded systems, as in microcomputers, the built-in drivers are permanently enabled and separate tri-state drivers employed for the data bus isolation.
7.6 Control Logic:
The control logic provides the necessary interface between the microprocessor system and the elements of the acquisition unit in providing the necessary timing control. It is to ensure that the correct analog signal is selected, sampled at the correct time, initiate the A/D conversion process (start-conversion=SC) and signals to the microprocessors on completion of conversion (End of conversion=EOC).
7.7 Output Interface:
Digital output signals often have to be converted into analog form so that they can be used and acted upon by external circuits, e.g., oscilloscope, chart recorder, etc.Therefore, digital-to-analog (D/A) converters are used for converting a signal in a digital format into an analog form. The output of the D/A converter is either current or voltage when presented with a binary signal at the input.
The input coding for the D/A converter is similar to the output coding of the A/D converter, while full-scale outputs are jumper-selectable for 0 to ±1, ±5 and ±10 V.D/A converters generally deliver the standard 4 to 20mA output and loading can range from 50 W to 4kW.The important parameters which govern the choice of an A/D converter or D/A converter are resolution, measurement frequency, input characteristics, offset error, noise, microprocessor compatibility and linearity, etc.
A microcontroller contains a CPU, clock circuitry, ROM, RAM and I/O circuitry on a single integrated circuit package. The microcontroller is therefore, a self-contained device, which does not require a host of associated support chips for its operation as conventional microprocessors do. It offers several advantages over conventional multichip systems. There is a cost and space advantage as extra chip costs and printed circuit board and connectors required to support multichip systems are eliminated. The other advantages include cheaper maintenance, decreased hardware design effort and decreased board density, which is relevant in portable medical equipment.
Microcontrollers have traditionally been characterized by low cost high volume products requiring a relatively simple and cheap computer controller. The design optimization parameters require careful consideration of architectural tradeoffs, memory design factors, instruction size, memory addressing techniques and other design constraints with respect to area and performance. Microcontroller's functionality, however, has been tremendously increased in the recent years.Today; one gets microcontrollers, which are stand alone for applications in data acquisition system and control. They have analog-to-digital converters on chip, which enable them direct use in instrumentation. Another type of microcontroller has on-chip communication controller, which is designed for applications requiring local intelligence at remote nodes and communication capability among these distributed nodes. Advanced versions of the microcontrollers in 16-bit configuration have been introduced for high performance requirements particularly in applications where good arithmetical capabilities are required.
The A/D conversion is proposed to be performed by a 89C51 controller. A total of 3 Channels are employed, one for each EMG signal from the 3 muscles: Flexor Carpi Radialis, Extensor Carpi Radialis and Biceps Brachii.The Sampling frequency is set at 10 KHz. This frequency is 10 times greater than 1 KHz, which is the maximum frequency of the analogue signal out of the anti-aliasing filter.
The conversion has a 19.5mV resolution with an 8-bit quantification. This voltage resolution and quantification has demonstrated to be sufficient to provide accurate measurements of the EMG signals. After the AD conversion, the signals are transmitted to the computer via RS-232.The baud rate is set at 115.2Kbps.The time required for the transmission of a byte (10 bits) is 86.8 µs and can be performed within a sampling rate (100 µs).