Файл: Single- and Multi-Chip Microcontroller Interfacing For the Motorola 68HC12 (G.J. Lipovski, 1999).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 15.06.2025

Просмотров: 778

Скачиваний: 2

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

14 Chapter 7 Analog Interfacing

or relative pressure to within 1% accuracy. These marvelous devices contain the diaphragm, strain gauge position sensor, compensation circuits for temperature, and output amplifier on a hybrid integrated circuit. Finally, weight is normally measured by he force that gravity generates. The weighing device, called a load cell, is essentially a piston. Objects are weighed by putting them on top of the piston, and the pressure of he fluid inside the piston is measured.

Other properties - including chemical composition and concentration, the pHof iquids, and so on - are sometimes measured by transducers. However, a discussionof hese transducers goes beyond the scope of this introductory survey.

7.2 Basic Analog Processing Components

Basic analog devices include power amplifiers, operational amplifiers, analog switches, and the timer module. These will be discussed in this section. The first subsection discusses transistors and SCRs, the next discusses OP AMPs and analog switches in general, and the last discusses practical OP AMPs and analog switches.

7.2.1 Transistors and Silicon Controlled Rectifiers

To convert a voltage or current to some other property like position or temperature, an amplifier is needed to provide enough power to run a motor or a heater. We briefly urvey the common power amplifier devices often used with microcomputers. These nclude power transistors, darlington transistors, and VFETs for control of DC devices; motors, heaters, and so on) and SCRs and triacs for control of AC devices.

The (bipolar) transistor is a device that has terminals called the collector, base, and mitter. (See Figure 7.3a.) The collector current Ic is a constant (called the beta) times he base current Ib. The power transistor can be obtained in various capacities, able to handle up to 100 A, and up to 1000 V. These are most commonly used for control of DC devices. A darlington transistor has a pair of simple transistors connected internally o it appears to be a single transistor with very high beta. (See Figure 7.3b.) Power darlington transistors require less base current Ib to drive a given load, so they are often sed with microprocessor I/O chips that have limited current output. Field-effect ransistors (FETs) can be used in place of the more conventional (bipolar) transistor. In n FET, the current flowing from drain to source is proportional to the voltage from

gate to source. Very little current flows into the gate, which is essentially

a capacitor

with a small leakage current. (See Figure 7.3c.) However, a vertical

field-effect

ransistor (VFET) is faster than a standard FET and can withstand larger voltages (about 00 V) between drain and source. The VFET is therefore a superb output amplifier that s most compatible with microcomputers. Suffice to say that for this survey, a power ransistor, a darlington, or a VFET is usually required to drive a DC device like a motor, eater, or lamp.



8

Counters and Timers

The counter/timer is one of the most flexible parts of a single-chip microcomputer. It can generate a square wave. The square wave can be used to generate sine waves, or any periodic wave. Sine waves can be used in telephone systems (touch-tone), and signals to the user (bleeps). The counter/timer can be used to generate single-shot pulses. These can control motors, solenoids, or lights to give precisely timed pulses that are independent of the timing errors to which the real-time programmed microprocessor is susceptible, such as dynamic memory and DMA cycle steals, and interrupts. The counter/timer can itself provide interrupts to coordinate a program, to effect an instruction step, or to effect a real-time clock. To effect an instruction step, the timer is set up as the monitor is left so that it allows one instruction to be executed in the user program before the interrupt returns control to the monitor. The monitor is used to examine or modify memory or registers, then the monitor is left and the next instruction in the user program is executed, and so on. Or a real-time clock can be effected if the timer interrupts every millisecond. The device can be used to count the number of events (falling edges of a signal input to the device), and thus the number of events in a fixed interval of time (the frequency). It is also capable of measuring pulse width and period. Several things can be converted to the period of a signal: voltage can be converted using the voltage-to-frequency converter's integrated circuits, and resistance or capacitance can be converted to the period of a waveform using a linear timer integrated circuit like the ubiquitous 555. We also observe that a single signal can be easily isolated using optical isolators, so the voltage of the system being measured can be kept from the microcomputer and the user. The 'A4 counter/timer was designed for these purposes.

The counter/timer is the principal component, then, in interfacing to frequency analog signals. These signals, like FM radio signals, are easier to handle than amplitude analog signals and are comparatively free of noise. We observe that, at the time of writing, amplitude analog signals are pervasively used in interface circuits; but we believe that frequency (or phase) analog signals will become equally important.

The primary objective of this chapter is to explain the principles of using the counter/timer device. To make these principles concrete, the "A4counter/timer system is introduced. A further objective of this chapter is to emphasize a fundamental principle of top-down design. A counter/timerin a microcomputer is so fascinating that the designer

361



9

Communications Systems

The microcomputer has many uses in communications systems, and a communications ystem is often a significant part of a microcomputer. This chapter examines techniques or digital communications of computer data.

Attention is focused on a microcomputer's communications subsystem - the part hat interfaces slower I/O devices like typewriters and printers to the microcomputer. This is often a universal asynchronous receiver-transmitter (UART). Because of their opularity in this application, UARTs have been used for a variety of communications unctions, including remote-control and multiple-computer intercommunications. However, their use is limited to communicating short (1-byte) messages at slow rates less than 1000 bytes per second). The synchronous data link control (SDLC) is suitable or sending longer messages (about 1000 bytes) at faster rates (about 1,000,000 bits per econd), such as for sending data between computers or between computers and fast I/O evices. The IEEE-488 bus, for microcomputer control of instruments like digital oltmeters and frequency generators, and the SCSI bus, for communication to and from ntelligent peripherals, send a byte at a time rather than a bit at a time.

The overall principles of communications systems, including the ideas of levels and rotocols, are introduced in the first section. The signal transmission medium is iscussed next, covering some typical problems and techniques communications ngineers encountered in moving data. The UART and related devices that use the same ommunications mechanisms are fundamental to I/O interface design. So, we spend quite bit of time on these devices, imparting basic information about their hardware and oftware. They will probably find use in most of your designs for communicating with eletypes or teletype-like terminals, keyboards, and CRTs, as well as for simple remote ontrol. Finally, we look at the more complex communications interfaces used between arge mainframe computers to control test and measurement equipment in the laboratory nd to connect intelligent I/O.

Communications terminology is rather involved, with roots in the (comparatively ncient) telephone industry and in the computer industry, and some terms stemming niquely from digital communications. Communications design is almost a completely ifferent discipline from microcomputer design. Moreover, one kind of system, such as ne using UARTs, uses quite different terminology than that used to describe another, imilar system, such as one using SDLC links. While it is important to be able to talk

397