
- •Objectives
- •Embedded Microcomputer Applications
- •Microcomputer and Microcontroller Architectures
- •Digital Hardware Concepts
- •Voltage, Current, and Resistance
- •Diodes
- •Transistors
- •Mechanical Switches
- •Transistor Switch ON
- •Transistor Switch OFF
- •The FET as a Logic Switch
- •NMOS Logic
- •CMOS Logic
- •Mixed MOS
- •Logic Symbols
- •Tri-State Logic
- •Timing Diagrams
- •Multiplexed Bus
- •Loading and Noise Margin Analysis
- •The Design and Development Process
- •Chapter One Problems
- •2 Microcontroller Concepts
- •Organization: von Neumann vs. Harvard
- •Microprocessor/Microcontroller Basics
- •Microcontroller CPU, Memory, and I/O
- •Design Methodology
- •Introduction to the 8051 Architecture
- •Memory Organization
- •CPU Hardware
- •Oscillator and Timing Circuitry
- •The 8051 Microcontroller Instruction Set Summary
- •Direct and Register Addressing
- •Indirect Addressing
- •Immediate Addressing
- •Generic Address Modes and Instruction Formats
- •Address Modes
- •The Software Development Cycle
- •Software Development Tools
- •Chapter Two Problems
- •Timing Diagram Notation Conventions
- •Rise and Fall Times
- •Propagation Delays
- •Setup and Hold Time
- •Tri-State Bus Interfacing
- •Pulse Width and Clock Frequency
- •Fan-Out and Loading Analysis—DC and AC
- •Calculating Wiring Capacitance
- •Fan-Out When CMOS Drives LSTTL
- •Transmission Line Effects
- •Ground Bounce
- •Logic Family IC Characteristics and Interfacing
- •Interfacing TTL Compatible Signals to 5 Volt CMOS
- •Design Example: Noise Margin Analysis Spreadsheet
- •Worst-Case Timing Analysis Example
- •Chapter Three Review Problems
- •Memory Taxonomy
- •Secondary Memory
- •Sequential Access Memory
- •Direct Access Memory
- •Read/Write Memories
- •Read-Only Memory
- •Other Memory Types
- •JEDEC Memory Pin-Outs
- •Device Programmers
- •Memory Organization Considerations
- •Parametric Considerations
- •Asynchronous vs. Synchronous Memory
- •Error Detection and Correction
- •Error Sources
- •Confidence Checks
- •Memory Management
- •Cache Memory
- •Virtual Memory
- •CPU Control Lines for Memory Interfacing
- •Chapter Four Problems
- •Read and Write Operations
- •Address, Data, and Control Buses
- •Address Spaces and Decoding
- •Address Map
- •Chapter Five Problems
- •The Central Processing Unit (CPU)
- •External Data Memory Cycles
- •External Memory Data Memory Read
- •External Data Memory Write
- •Design Problem 1
- •Design Problem 2
- •Design Problem 3
- •Completing the Analysis
- •Chapter Six Problems
- •Memory Selection and Interfacing
- •Preliminary Timing Analysis
- •Introduction to Programmable Logic
- •Technologies: Fuse-Link, EPROM, EEPROM, and RAM Storage
- •PROM as PLD
- •Programmable Logic Arrays
- •PAL-Style PLDs
- •Design Examples
- •PLD Development Tools
- •Simple I/O Decoding and Interfacing Using PLDs
- •IC Design Using PCs
- •Chapter Seven Problems
- •Direct CPU I/O Interfacing
- •Port I/O for the 8051 Family
- •Output Current Limitations
- •Simple Input/Output Devices
- •Matrix Keyboard Input
- •Program-Controlled I/O Bus Interfacing
- •Real-Time Processing
- •Direct Memory Access (DMA)
- •Burst vs. Single Cycle DMA
- •Cycle Stealing
- •Elementary I/O Devices and Applications
- •Timing and Level Conversion Considerations
- •Level Conversion
- •Power Relays
- •Chapter Eight Problems
- •Interrupt Cycles
- •Software Interrupts
- •Hardware Interrupts
- •Interrupt Driven Program Elements
- •Critical Code Segments
- •Semaphores
- •Interrupt Processing Options
- •Level and Edge Triggered Interrupts
- •Vectored Interrupts
- •Non-Vectored Interrupts
- •Serial Interrupt Prioritization
- •Parallel Interrupt Prioritization
- •Construction Methods
- •10 Other Useful Stuff
- •Electromagnetic Compatibility
- •Electrostatic Discharge Effects
- •Fault Tolerance
- •Software Development Tools
- •Other Specialized Design Considerations
- •Thermal Analysis and Design
- •Battery Powered System Design Considerations
- •Processor Performance Metrics
- •Device Selection Process
- •Power and Ground Planes
- •Ground Problems
- •11 Other Interfaces
- •Analog Signal Conversion
- •Special Proprietary Synchronous Serial Interfaces
- •Unconventional Use of DRAM for Low Cost Data Storage
- •Digital Signal Processing / Digital Audio Recording
- •Detailed Checklist
- •Define Power Supply Requirements
- •Verify Voltage Level Compatibility
- •Check DC Fan-Out: Output Current Drive vs. Loading
- •Verify Worst Case Timing Conditions
- •Determine if Transmission Line Termination is Required
- •Clock Distribution
- •Power and Ground Distribution
- •Asynchronous Inputs
- •Guarantee Power-On Reset State
- •Programmable Logic Devices
- •Deactivate Interrupt and Other Requests on Power-Up
- •Electromagnetic Compatibility Issues
- •Manufacturing and Test Issues
- •Books
- •Web and FTP Sites
- •Periodicals: Subscription
- •Periodicals: Advertiser Supported Trade Magazines
- •Programming Microcontrollers in C, Second Edition
- •Controlling the World with Your PC
- •The Forrest Mims Engineers Notebook
- •The Forrest Mims Circuit Scrapbook, Volumes I and II
- •The Integrated Circuit Hobbyist’s Handbook
- •Simple, Low-Cost Electronics Projects

17CHAPTER ONE
Review of Electronics Fundamentals
curve, Vo at Io max. As a result, |
max |
V OH |
V OL |
||
the best we can do is to look |
|
|
OLmax |
||
|
OH |
Vcc |
|||
at the output characteristics |
V |
||||
I |
|
||||
graphically, as shown in |
OH max |
|
I |
||
|
|
|
|
||
Figure 1-17. |
|
|
|
VOL max |
|
|
-I OH |
|
|
IOL |
|
Logic Symbols |
|
Figure 1-17: Output voltage Vo versus current Io. |
Logic symbols are used to represent the logic functions in a more abstract way, allowing the designer to specify the logical function of a circuit without getting into the details of the underlying components (such as the transistors and resistors). The logic symbols used in this text represent those that are most commonly used in commercial documentation. There are other standards, such as the ANSI/IEEE standard gate level symbols, but they are not encountered as frequently in practice. Figure
1-18 shows the logic symbols for |
A |
|
|
F |
A |
|
F |
A |
|
|
|
F |
A |
|
|
|
F |
||||||
|
|
|
|
|
|
|
|||||||||||||||||
|
|
B |
|
B |
|
|
|
B |
|
|
|
|
|||||||||||
|
|
|
|
|
|
OR |
|
|
XOR |
||||||||||||||
different gates, and their functions |
|
Buffer |
|
|
AND |
|
|
|
|
|
|
||||||||||||
|
F = A |
|
|
F = AB |
|
F = A+B |
|
F = A+B |
|||||||||||||||
are described in the truth tables. |
|
A F |
|
|
A B F |
|
A B F |
|
A B F |
||||||||||||||
|
|
|
|
|
|
||||||||||||||||||
The logic symbols in Figure 1-18 |
0 |
0 |
|
0 0 |
|
0 |
|
0 0 |
0 |
|
0 0 |
0 |
|
||||||||||
1 |
1 |
|
0 1 |
|
0 |
|
0 1 |
1 |
|
0 1 |
1 |
|
|||||||||||
show the shapes and Boolean logic |
|
|
|
|
1 0 |
|
0 |
|
1 0 |
1 |
|
1 0 |
1 |
|
|||||||||
functions for the most common |
|
|
|
|
1 1 |
|
1 |
|
1 1 |
1 |
|
1 1 |
0 |
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gate configurations. The buffer |
A |
|
|
F |
A |
|
|
|
|
|
F |
A |
|
|
|
|
F |
A |
|
|
|
|
F |
device is a triangle—the symbol |
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
|
|
B |
|
|
|
|
|
B |
|
|
|
|
B |
|
|
|
|
||||||
Inverter |
|
NAND |
NOR |
XNOR |
|||||||||||||||||||
for an amplifier—because it |
|
|
|
|
|||||||||||||||||||
|
F = A |
|
|
F = AB |
|
F = A+B |
|
F = A+B |
|||||||||||||||
amplifies the input signal, allowing |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
A |
F |
|
|
A B |
|
F |
|
|
A B |
F |
|
A B |
F |
|||||||||
an increase in the number of loads |
0 |
1 |
|
|
|
0 0 |
|
1 |
|
0 0 |
1 |
|
0 0 |
1 |
|
||||||||
that can be driven. Note that a |
1 |
0 |
|
|
0 1 |
|
1 |
|
0 1 |
0 |
|
0 1 |
0 |
|
|||||||||
|
|
|
|
|
|
1 0 |
|
1 |
|
1 0 |
0 |
|
1 0 |
0 |
|
||||||||
small circle, often referred to as a |
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
1 1 |
|
0 |
|
1 1 |
0 |
|
1 1 |
1 |
|
|||||||||
“bubble,” on an input or output |
|
Figure 1-18: Logic symbols, symbolic notation, |
|
|
|||||||||||||||||||
terminal designates a logical inver- |
|
|
|
||||||||||||||||||||
|
and truth tables. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
sion. Thus the inverter is shown as |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
a triangle (amplifier) with a bubble on the output to signify the logic level |
|
|
|||||||||||||||||||||
inversion on the output. The logic voltage levels for TTL logic are: |
|
|
|
|
|
|
|||||||||||||||||
Positive Logic |
Corresponding TTL Logic Voltages |
|
|
||||||||||||||||||||
0 = false = lowest voltage level |
0 = input voltages 0 to 0.8 volts (low) |
|
|
||||||||||||||||||||
1 = true = highest voltage level |
1 = input voltages 2 to 5 volts (high) |
|
|

18EMBEDDED CONTROLLER
Hardware Design
This means that a TTL compatible logic input is guaranteed to respond to an input signal between 0 and 0.8 volts as a logic zero, and input voltages from 2 to 5 volts as a logic one. Note that voltages between 0.8 and 2 volts are not valid logic levels.
Logic voltage levels are different for different types of logic, but the most common logic levels are those corresponding to the original TTL (transistor transistor logic), using a 5 volt power supply. CMOS levels, using 3 or 5 volt power, are also common. TTL and CMOS logic—like almost every other type of logic in common use —are called positive logic because the most positive voltage corresponds to the logic one value.
Tri-State Logic
Tri-state logic does not refer to orderly thinking in a three state geographic region! When we speak of binary (base two number) values, we mean that a given bit or logic signal can take on either one of two valid states (zero or one) at any instant in time. A logic gate that is not forcing its output to be either one or zero is said to be tri-stated. Tri-state logic does not refer to base three numbers, but rather to a third invalid logic state when the output of a logic device is neither sinking nor sourcing current. This so-called third state is really an undefined
condition, because the |
Tri-State Inverting Buffer |
Output ENabled |
Output DISabled |
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
? |
|||
device output is not |
A |
|
|
|
Y |
A |
|
|
|
|
|
|
|||
|
|
|
|
|
A |
A |
|
|
OFF |
||||||
|
|
|
|
|
|
|
|||||||||
forcing a logic level on |
Input |
|
Output |
|
|
|
|
|
|
|
|
|
HI-Z |
||
|
|
OE |
|
1 |
|
|
|
|
0 |
|
|||||
its output. It is said to be |
|
|
|
|
|
|
|
|
|||||||
|
Truth Table |
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
in a floating, high impedance, passive, or Hi-Z state, since the output circuits are effectively disconnected. A tri-state driver connected to one signal wire of the bus is shown in Figure 1-19.
|
A |
OE |
Y |
|
|
|
|
|
|
NC |
|
0 |
1 |
1 |
|
|
|
|
|
|
|
|
|
Output |
|
Output |
||||||
|
1 |
1 |
0 |
|
|
|||||
|
|
Switch |
|
Switch |
||||||
|
0 |
0 |
? |
Hi-Z |
ON |
|
OFF |
|||
|
|
|
|
|
(closed) |
|
(open) |
|||
|
1 |
0 |
? |
Hi-Z |
||||||
|
|
|
|
|
|
|
||||
Symbol and Function |
Equivalent Circuit – Active and Passive |
Figure 1-19: Active and passive states of a tri-state buffer.
On the left is an inverting buffer with an enabled tri-state output. On the right side is an example showing two of the same type of buffers, with the top device in the disabled or passive state, and the lower device is enabled