
- •Table of Contents
- •Preface
- •Additional Material
- •Basic Electronics
- •1.0 The Atom
- •1.1 Isotopes and Ions
- •1.2 Static Electricity
- •1.3 Electrical Charge
- •1.4 Electrical Circuits
- •1.5 Circuit Elements
- •1.6 Semiconductors
- •Number Systems
- •2.0 Counting
- •2.1 The Origins of the Decimal System
- •2.2 Types of Numbers
- •2.3 Radix Representations
- •2.4 Number System Conversions
- •Data Types and Data Storage
- •3.0 Electronic-Digital Machines
- •3.1 Character Representations
- •3.2 Storage and Encoding of Integers
- •3.3 Encoding of Fractional Numbers
- •3.4 Binary-Coded Decimals (BCD)
- •Digital Logic, Arithmetic, and Conversions
- •4.0 Microcontroller Logic and Arithmetic
- •4.1 Logical Instructions
- •4.2 Microcontroller Arithmetic
- •4.3 Bit Manipulations and Auxiliary Operations
- •4.4 Unsigned Binary Arithmetic
- •4.5 Signed Binary Arithmetic
- •4.6 Data Format Conversions
- •Circuits and Logic Gates
- •5.0 Digital Circuits
- •5.1 The Diode Revisited
- •5.2 The Transistor
- •5.3 Logic Gates
- •5.4 Transistor-Transistor Logic
- •5.5 Other TTL Logic Families
- •5.6 CMOS Logic Gates
- •Circuit Components
- •6.0 Power Supplies
- •6.1 Clocked Logic and Flip-flops
- •6.2 Clocks
- •6.3 Frequency Dividers and Counters
- •6.4 Multiplexers and Demultiplexers
- •6.5 Input Devices
- •The Microchip PIC
- •7.0 The PICMicro Microcontroller
- •7.1 PIC Architecture
- •Mid-range PIC Architecture
- •8.0 Processor Architecture and Design
- •8.1 The Mid-range Core Features
- •8.2 Mid-Range CPU and Instruction Set
- •8.3 EEPROM Data Storage
- •8.4 Data Memory Organization
- •8.5 Mid-range I/O and Peripheral Modules
- •PIC Programming: Tools and Techniques
- •9.0 Microchip’s MPLAB
- •9.1 Integrated Development Environment
- •9.2 Simulators and Debuggers
- •9.3 Programmers
- •9.4 Engineering PIC Software
- •9.5 Pseudo Instructions
- •Programming Essentials: Input and Output
- •10.0 16F84A Programming Template
- •10.1 Introducing the 16F84A
- •10.2 Simple Circuits and Programs
- •10.3 Programming the Seven-segment LED
- •10.4 A Demonstration Board
- •Interrupts
- •11.0 Interrupts on the 16F84
- •11.1 Interrupt Sources
- •11.2 Interrupt Handlers
- •11.3 Interrupt Programming
- •11.4 Sample Programs
- •Timers and Counters
- •12.0 The 16F84 Timer0 Module
- •12.1 Delays Using Timer0
- •12.2 Timer0 as a Counter
- •12.3 Timer0 Programming
- •12.4 The Watchdog Timer
- •12.5 Sample Programs
- •LCD Interfacing and Programming
- •13.0 LCD Features and Architecture
- •13.1 Interfacing with the HD44780
- •13.2 HD44780 Instruction Set
- •13.3 LCD Programming
- •13.4 Sample Programs
- •Communications
- •14.0 PIC Communications Overview
- •14.1 Serial Data Transmission
- •14.2 Parallel Data Transmission
- •14.4 PIC Protocol-based Serial Programming
- •14.5 Sample Programs
- •Data EEPROM Programming
- •15.0 PIC Internal EEPROM Memory
- •15.1 EEPROM Devices and Interfaces
- •15.2 Sample Programs
- •Analog to Digital and Realtime Clocks
- •16.0 A/D Converters
- •16.1 A/D Integrated Circuits
- •16.2 PIC On-Board A/D Hardware
- •16.3 Realtime Clocks
- •16.4 Sample Programs
- •Index

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.