Файл: Embedded Controller Hardware Design (Ken Arnold, 2000).pdf

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

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

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

Добавлен: 13.06.2025

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

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

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

8EMBEDDED CONTROLLER

Hardware Design

equation V = I * R, as shown in Figure 1-5. This is known as Ohm’s law.

Another way to look at it is that whenever current flows through a resistor,

there is a drop in voltage

I

across the resistor due

+

Current (I)

Positive

to the restriction

through

Pressure

in current.

V R

Resistor (R)

causes

Voltage

Real components are

drop (V)

Zero Volts

V = I R

Zero

not the perfect voltage

'ground'

Reference

sources, resistances,

Power dissipated in Resistor

Atmospheric

2

E2

Pressure

is P = I

R = V

I =

etc. we have discussed

R

so far. They have para-

Figure 1-5: Voltage across R is equal to current multiplied by resistance.

sitic values that limit

their performance in the real world and are subject to other limitations, such as operating temperature, power limits, etc. Current flows only through a complete circuit, and in most cases (for a positive power supply) current flows from the power source through the circuitry and returns to the power supply through the common “ground” connection. Current flowing through any resistance results in the dissipation of power as heat. The power dissipated is P = I2R = V*I = V2/R. Note that voltage is sometimes denoted by the variable V and sometimes by E, for electromotive force.

All practical components have some resistance. Real batteries have an internal resistance, for example, which provides an upper limit to the current the battery can supply to an external circuit. Real wires have resistance as well, so the actual performance of a circuit will deviate somewhat from the ideal. These effects are obvious in some cases, but not in others. In an automobile starting circuit, it’s not surprising that the battery, supplying 12 volts to a starter with internal resistance on the order of 0.01 to 0.1 ohms, will result in currents of hundreds of amperes in order to start the engine. On the other hand, while consulting with a prominent notebook computer manufacturer, I uncovered a design error resulting in an internal current of hundreds of amperes flowing in the circuit for a few nanoseconds. Obviously, this wreaked havoc on the operation of the computer, and generated a great deal of electromagnetic noise!

One of the things you will learn in this book is how to avoid those kinds of mistakes. It’s also important to remember that power is dissipated in any resistance present in the circuit. The power is proportional to the voltage times


No Current
Flows
Figure 1-6: A diode to electricity is analogous to a valve in the flow of a fluid.
Valve “Closed”
Valve “Open”
Current Flows

9CHAPTER ONE

Review of Electronics Fundamentals

the current across the resistance, which is dissipating the power. In the last two examples, the amount of power dissipated instantaneously is quite high while the current is flowing. When the current pulse is only a few nanoseconds long,

however, it may not be

obvious, since there won’t

Diode is analgous

be much heat generated.

Current

to a one-way valve.

Current can only

flow in one direction.

Diodes

Diode

“On”

The diode is a simple semiconductor device

acting as a “one way” + current valve. It only

lets current flow in one direction. Figure 1-6 illustrates how the diode operates like a “one-way” fluid valve.

Diode

“Off”

+

(Purists please note:

This book does not use electron current flow.

All electrical current flow will be “positive” or “conventional” current flow, meaning current

always flows from the most positive terminal to the most negative terminal of a component. The use of positive current flow follows the intuitive direction of the arrows inherent in the component drawings for diodes, transistors, etc.)

Transistors

The flow analogy can also be used to model how a transistor operates in a logic circuit. The transistor is an amplifier. It uses a small amount of energy to control a larger energy source, just as a valve controls a high-pressure water source.

There are two kinds of transistors: bipolar and field-effect transistors (FETs). We will look at bipolar transistors first; these amplify current. A small amount


10EMBEDDED CONTROLLER

Hardware Design

of current flows in the control

Collector

circuit (the transistor base-

P

emitter circuit) to turn the tran-

Base

N

sistor on. This control current is

P

Emitter

Current

amplified (multiplied by the gain

Flow

or beta of the transistor) and

“Source”

Current

Control

allows a larger current to flow in

Flow

the output circuit (the collector-

emitter circuit). Once again, the

“Sink”

device is not perfect because of

Figure 1-7: Operation of a bipolar PNP transistor.

the resistance, current, gain, and

leakage limitations of real transistors. Bipolar transistors come in two polarities, NPN and PNP, with the difference being the direction in which current flows for normal operation. A

bipolar PNP transistor is shown

Collector

N

and modeled in Figure 1-7.

Base

P

N

For most of the illustrative circuit

Emitter

Current

examples in this book, we will be

“Sink”

Flow

using NPN transistors, as shown

Current

in Figure 1-8.

Flow

Control

“Source”

Mechanical Switches

Figure 1-8: Operation of a bipolar NPN transistor.

Mechanical switches are useful for direct input to digital circuits. One of the more convenient versions is a bank of rocker switches packaged into a module that can fit into the same location as a standard chip. The dual in-line package, or DIP, switch is one of the easiest ways to add multiple switches to a microcontroller design. The mechanical switch has extremely low “on” resistance and high “off” resistance, unlike most semiconductor switches. Figure 1-9 shows a typical DIP switch and the schematic symbol for it.

N

F

O

F

O

Figure 1-9: 8-position DIP switch and schematic equivalent.


11CHAPTER ONE

Review of Electronics Fundamentals

Transistor Switch ON

Transistors can be configured to function as switches. As can be seen in Figure 1-10, an NPN transistor operating as a current controlled switch can be used to build a simple inverter. It changes a logic one on its input to a logic zero at its output, and vice versa. In this case, logic one is represented as a positive voltage, and a logic zero is represented by zero volts. The logic one input (positive input voltage) is supplied through a resistor from the power supply voltage to the transistor base terminal, resulting in a small base control current into the base.

Transistor Inverter

Transistor Inverter

Input 1 -> Output 0

Equivalent Circuit

Resistor

Sources

Current

“0”

“1”

“0”

“1”

+

Output

+

Output

Sinks

Sinks

Transistor

Current

Transistor

Current

ON

ON

(shorted)

(shorted)

Transistor Switch “ON”

Equivalent Circuit

Figure 1-10: The transistor inverter; input = 1 and transistor ON. The transistor

ON configuration is at left and the equivalent circuit is at right.

The transistor is used because it has gain allowing a larger output current to flow as controlled by a weaker input. When the transistor is turned on as much as it can be, the collector emitter circuit looks almost like a short circuit, effectively connecting the output to ground or zero volts. This gives a logic zero on the collector output. When the transistor collector is shorted to ground, current flows from the supply through the resistor and into the transistor collector to ground. The transistor is said to sink the resistor current into ground. If there is an external load, such as another inverter or gate, connected to the collector output, the transistor can also sink current from the load. This is also referred to as pulling down the output voltage. The current sinking capacity of the transistor limits the number of devices this inverter can drive.