Файл: Microcontroller Programming. Thi Micro Chip PIC (Julio Sanchez, 2007).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 14.06.2025
Просмотров: 8512
Скачиваний: 0
12 |
Chapter 1 |
Figure 1-14 Resistors
Figure 1-14 shows several commercial resistors. The integrated circuit at the center of the image combines eight resistors of the same value. These devices are convenient when the circuit design calls for several identical resistors. The color-coded cylindrical resistors in the image are made of carbon
Appendix A contains the color codes used in identifying resistors whose surface area does not allow printing its value.
1.5.4 Capacitors
An element often used in the control of the flow of an electrical charge is a capacitor.
The name originated in the notion of a "capacity" to store charge. In that sense a capacitor functions as a small battery. Capacitors are made of two conducting surfaces separated by an insulator. A wire lead is usually connected to each surface. Two large metal plates separated by air would perform as a capacitor. More frequently capacitors are made of thin metal foils separated by a plastic film or another form of solid insulator. Figure 1-15 shows a circuit which contains both a capacitor and a resistor.
In Figure 1-15 charge flows from the battery terminals, along the conductor wire, onto the capacitor plates. Positive charges collect on one plate and negative charges on the other plate. The initial current is limited only by the resistance of the wires and by the resistor in the circuit. As charge builds up on the plates, charge repulsion resists the flow and the current is reduced. At some point the repulsive force from charge on the plates is strong enough to balance the force from charge on the battery, and the current stops.
+
-
Figure 1-15 Capacitor Circuit
Basic Electronics |
13 |
The existence of charges on the capacitor plates means there must be a voltage between the plates. When the current stops this voltage is equal to the voltage in the battery. Since the points in the circuit are connected by conductors, then they have the same voltage, even if there is a resistor in the circuit. If the current is zero, there is no voltage across the resistor, according to Ohm's law.
The amount of charge on the plates of the capacitor is a measure of the value of the capacitor. This "capacitance" is measured in farads (f), named in honor of the English scientist Michael Faraday.
The relationship is expressed by the equation:
C = Q
V
where C is the capacitance in farads, Q is the charge in Coulombs, and V is the voltage. Capacitors of one farad or more are rare. Generally capacitors are rated in microfarads (µf), one-millionth of a farad, or picofarads (pf), one-trillionth of a farad.
Consider the circuit of Figure 1-15 after the current has stabilized. If we now remove the capacitor from the circuit it still holds a charge on its plates. That is, there is a voltage between the capacitor terminals. In one sense, the charged capacitor appears somewhat like a battery. If we were to short-circuit the capacitor's terminals a current would flow as the positive and negative charges neutralize each other. But unlike a battery, the capacitor does not replace its charge. So the voltage drops, the current drops, and finally there is no net charge and no voltage difference anywhere in the circuit.
1.5.5 Capacitors in Series and in Parallel
Like resistors, capacitors can be joined together in series and in parallel. Connecting two capacitors in parallel results in a bigger capacitance value, since there is a larger plate area. Thus, the formula for total capacitance (CT) in a parallel circuit containing capacitors C1 and C2 is:
CT = C1 + C2
Note that the formula for calculating capacitance in parallel is similar to the one for calculating series resistance. By the same token, where several capacitors are connected in series the formula for calculating the total capacitance is:
CT = 1 + 11 + 1 ...
C1 C2 C3
14 |
Chapter 1 |
Figure 1-16 Assorted Commercial Capacitors
Note that the total capacitance of a connection in series is lower than for any capacitor in the series, considering that for a given voltage across the entire group there is less charge on each plate.
There are several types of commercial capacitors, including mylar, ceramic, disk, and electrolytic. Figure 1-16 shows several commercial capacitors.
1.5.6 Inductors
Inductors are the third type of basic circuit components. An inductor is a coil of wire with many windings. The wire windings are often made around a core of a magnetic material, such as iron. The properties of inductors are derived from magnetic rather than electric forces.
When current flows through a coil it produces a magnetic field in the space outside the wire. This makes the coil behave just like a natural, permanent magnet. Moving a wire through a magnetic field generates a current in the wire, and this current will flow through the associated circuit. Since it takes mechanical energy to move the wire through the field, then it is the mechanical energy that is transformed into electrical energy. A generator is a device that converts mechanical to electrical energy by means of induction. An electric motor is the opposite of a generator. In the motor electrical energy is converted to mechanical energy by means of induction.
The current in an inductor is similar to the voltage across a capacitor. In both cases it takes time to change the voltage from an initially high current flow. Such induced voltages can be very high and can damage other circuit components, so it is common to connect a resistor or a capacitor across the inductor to provide a current path to absorb the induced voltage. In combination inductors behave just like resistors: inductance adds in series. By the same token, parallel connection reduces induction. Induction is measured in henrys (h), but more commonly in mh, and µh.
Basic Electronics |
15 |
PRIMARY |
SECONDARY |
WINDING |
WINDING |
Figure 1-17 Transformer Schematics
1.5.7 Transformers
The transformer is an induction device that changes voltage or current levels. The typical transformer has two or more windings wrapped around a core made of laminated iron sheets. One of the windings, called the primary, receives a fluctuating current. The other winding, called the secondary, produces a current induced by the primary. Figure 1-17 shows the schematics of a transformer.
The device in Figure 1-17 is a step-up transformer. This is determined by the number of windings in the primary and secondary coils. The ratio of the number of turns in each winding determines the voltage increase. A transformer with an equal number of turns in the primary and secondary transfers the current unaltered. This type of device is sometimes called an isolation transformer. A transformer with less turns in the secondary than in the primary is a step-down transformer and its effect is to reduce the primary voltage at the secondary.
Transformers require an alternating or fluctuating current since it is the fluctuations in the current flow in the primary that induce a current in the secondary. The ignition coil in an automobile is a transformer that converts the low-level battery voltage to the high voltage level necessary to produce a spark.
1.6 Semiconductors
The name semiconductor stems from the property of some materials that act either as a conductor or as an insulator depending on certain conditions. Several elements are classified as semiconductors including Silicon, Zinc, and Germanium. Silicon is the most widely used semiconductor material because it is easily obtained.
In the ultra-pure form of silicon the addition of minute amounts of certain impurities (called dopants) alters the atomic structure of the silicon. This determines whether the Silicon can then be made to act as a conductor or as a nonconductor, depending upon the polarity of an electrical charge applied to it.
In the early days of radio, receivers required a device called a rectifier to detect signals. Ferdinand Braun used the rectifying properties of the galena crystal, a semiconductor material composed of lead sulfide, to create a "cat's whisker" diode that served this purpose. This was the first semiconductor device.
16 |
Chapter 1 |
1.6.1 Integrated Circuits
Until 1959, electronic components performed a single function; therefore, many of them had to be wired together to create a functional circuit. Transistors were individually packaged in small cans. Packaging and hand wiring the components into circuits was extremely inefficient.
In 1959, at Fairchild Semiconductor, Jean Hoerni and Robert Noyce developed a process which made it possible to diffuse various layers onto the surface of a silicon wafer, while leaving a layer of protective oxide on the junctions. By allowing the metal interconnections to be evaporated onto the flat transistor surface the process replaced hand wiring. By 1961, nearly 90% of all the components manufactured were integrated circuits.
1.6.2 Semiconductor Electronics
To understand the workings of semiconductor devices we need to re-consider the nature of the electrical charge. Electrons are one of the components of atoms, and atoms are the building blocks of all matter. Atoms bond with each other to form molecules.
Molecules of just one type of atom are called elements. In this sense gold, oxygen, and plutonium are elements since they all consist of only one type of atom. When a molecule contains more than one atom it is known as a compound. Water, which has both hydrogen and oxygen atoms, is a compound. Figure 1-18 represents an orbital model of an atom with five protons and three electrons.
-
+ +
+
+ +
- -
Figure 1-18 Orbital Model of the Boron Atom with its Valence Electrons
In Figure 1-18, protons carry positive charge and electrons carry negative charge. Neutrons, not represented in the illustration, are not electrically charged. Atoms that have the same number of protons and electrons have no net electrical charge.
Electrons that are far from the nucleus are relatively free to move around since the attraction from the positive charge in the nucleus is weak at large distances. In fact, it takes little force to completely remove an outer electron from an atom, leaving an ion with a net positive charge. A free electron can move at speeds approaching the speed of light (approximately 186,282 miles per second).
Electric current takes place in metal conductors due to the flow of free electrons. Because electrons have negative charge, the flow is in a direction opposite to the
Basic Electronics |
17 |
positive current. Free electrons traveling through a conductor drift until they hit other electrons attached to atoms. These electrons are then dislodged from their orbits and replaced by the formerly free electrons. The newly freed electrons then start the process anew.
1.6.3 P-Type and N-Type Silicon
Semiconductor devices are made primarily of silicon. Pure silicon forms rigid crystals because of its four outermost electrons. Since it contains no free electrons it is not a conductor. But silicon can be made conductive by combining it with other elements (doping) such as boron and phosphorus. The boron atom has three outer valence electrons (Figure 1-18) and the phosphorus atom has five. When three silicon atoms and one phosphorus atom bind together, creating a structure of four atoms, there is an extra electron and a net negative charge.
The combination of silicon and phosphorous, with the extra phosphorus electron, is called an N-type silicon. In this case the N stands for the extra negative electron. The extra electron donated by the phosphorus atom can easily move through the crystal; therefore N-type silicon can carry an electrical current.
When a boron atom combines with a cluster of silicon atoms there is a deficiency of one electron in the resulting crystal. Silicon with a deficient electron is called P-type silicon (P stands for positive). The vacant electron position is sometimes called a "hole." An electron from another nearby atom can "fall" into this hole, thereby moving the hole to a new location. In this case, the hole can carry a current in the P-type silicon.
1.6.4 The Diode
Both P-type and N-type silicon conduct electricity. In either case, the conductivity is determined by the proportion of holes or the surplus of electrons. By forming some P-type silicon in a chip of N-type silicon it is possible to control electron flow so that it takes place in a single direction. This is the principle of the diode, and the p-n action is called a pn-junction.
A diode is said to have a forward bias if it has a positive voltage across it from the P- to N-type material. In this condition, the diode acts rather like a good conductor, and current can flow, as in Figure 1-19.
electron flow
e e
e e e
hole flow
+
-
Figure 1-19 A Forward Biased Diode
18 |
Chapter 1 |
If the polarity of the voltage applied to the silicon is reversed, then the diode is re- verse-biased and appears nonconducting. This nonsymmetric behavior is due to the properties of the pn-junction. The fact that a diode acts like a one-way valve for current is a very useful characteristic. One application is to convert alternating current (AC) into direct current (DC). Diodes are so often used for this purpose that they are sometimes called rectifiers.
Chapter 2
Number Systems
In order to perform more efficient digital operations on numeric data, mathematicians have devised systems and structures that differ from those used traditionally. This chapter presents the background material necessary for understanding and using the number systems and numeric data storage structures employed in digital devices.
2.0 Counting
The fundamental application of a number system is counting. A stone-age hunter uses his or her fingers to show other members of the tribe how many mammoths were spotted at the bottom of the ravine. In this manner the hunter is able to transmit a unique type of information that does not relate to the species, size, or color of the animals, but to their numbers. Our minds have the ability to capture this notion of "oneness" independently from other properties of objects.
The most primitive method of counting consists of using objects to represent degrees of oneness. The stone-age hunter uses fingers to represent individual mammoth. Alternatively, the hunter could have resorted to pebbles, sticks, lines on the ground, or scratches on the cave wall to show how many units there were of the object.
2.0.1 The Tally System
The tally system probably originated from notches on a stick or scratches on a cave wall. In its simplest form each scratch, notch, or line represents an object. The method is so simple and intuitive that we still resort to it occasionally. Tallying requires no knowledge of quantity and no elaborate symbols. Had there been 12 mammoth in the ravine the cave wall would have appeared as follows:
||||||||||||
A logical evolution of the tally system consists of grouping the marks. Since we have five fingers in each hand, the 12 mammoth may have been grouped as follows:
||||| ||||| ||
19
20 |
Chapter 2 |
Perhaps a primitive mathematical genius added one final sophistication to the tally system. By drawing one tally line diagonally the visualization is further improved, as in this familiar style:
2.0.2 Roman Numerals
Roman numerals show how a simple graphical tally system evolved into a symbolic numeric representation. The first five digits were encoded with the symbols:
I, II, III, IIII, and V
The Roman symbol V is conceivably a simplification of the tally encoding using a diagonal line to complete the grouping.
Table 2.1
Symbols in the Roman Numeration System
ROMAN |
DECIMAL |
I |
1 |
V |
5 |
X |
10 |
L |
50 |
C |
100 |
D |
500 |
M |
1000 |
The Roman numeral system is based on an add-subtract rule whereby the elements of a number, read left-to-right, are either added or subtracted to the previous sum according to its value. Thereby the decimal number 1994 is represented in Roman numerals as follows:
MCMXCIV = M + (C - M) + (X - C) + (I - V)
=1000 + (1000 - 100) + (100 - 10) + (5 - 1)
=1000 + 900 + 90 + 4
=1994
The uncertainty in the positional value of each digit, the absence of a symbol for zero, and the fact that some numbers require either one or two symbols (I, IV, V, IX, and X) complicate the rules of arithmetic using Roman numerals.
2.1 The Origins of the Decimal System
The one element of our civilization which has transcended all cultural and social differences is our decimal system of numbers. While mankind is yet to agree on the most desirable political order, on generally acceptable rules of moral behavior, or on a universal language, the Hindu-Arabic numerals have been adopted by practically all the nations and cultures of the world.