- •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
124EMBEDDED CONTROLLER
Hardware Design
Note also that two separate address ranges have been used, one for the input port and one for the output port. In practice, it is possible to have the input and output ports respond to the same address by using the read line for input cycles, and the write line for outputs.
Address Range |
Address bits |
Decoder Ouputs |
Active Select: |
|
(hex) |
A15 A14 A13 |
76543210 |
Memor y I/O |
|
0000 - 1FFF |
0 0 0 |
11111110 |
RAM 0 |
|
|
|
|
|
|
2000 - 3FFF |
0 0 1 |
11111101 |
RAM 1 |
|
|
|
|
|
|
4000 - 5FFF |
0 1 0 |
11111011 |
RAM 2 |
|
|
|
|
|
|
6000 - 7FFF |
0 1 1 |
11110111 |
RAM 3 |
|
|
|
|
|
|
8000 - 9FFF |
1 0 0 |
11101111 |
RAM 4 |
|
|
|
|
|
|
A000 |
- BFFF |
1 0 1 |
11011111 |
RAM 5 |
|
|
|
|
|
C000 |
- DFFF |
1 1 0 |
10111111 |
Output Port |
|
|
|
|
|
E000 |
- FFFF |
1 1 1 |
01111111 |
Input Port |
|
|
|
|
|
Table 5-2: External data memory map (8031 external memory space).
The decoder will select the input port at any address in the range E000 through FFFF hex. That means that the single input port bit takes up 8K address loca tions, all reading the same input port. This decoding technique is partial address decoding because only the three most significant address bits are decoded for this input port, and the rest of the address lines are effectively “don’t cares.” This may seem wasteful of address space, but it reduces the amount of decoding circuitry when it is not necessary to decode all the unique addresses individually. The memory map of the external data memory address space is shown in Table 5-2.
Chapter Five Problems
1.If the design of Figure 5-7 needs to be changed to eliminate the duplication of addresses caused by partial address decoding, how many additional input signals would be required for the decoder?
2.The 8031 CPU has 16 address lines. How much external memory can be attached to it without resorting to any memory extension mechanism?
3.If all bits of Port 1 on an 8031 are used to select external data memory in one of 256 “banks,” what is the maximum amount of external data memory that can be accessed?
4.What is the answer to life, the universe, and everything?
6 |
|
CHAPTER SIX |
125 |
A Detailed
Design Example
In this chapter, we will take a detailed look at the design and analysis of a simple microcontroller project. This chapter will illustrate the interactive nature of the design process. First, the preliminary design is analyzed for limitations and violations of the timing requirements for the various chips. Then modifications and additions to the design are made to improve the performance based on the analysis. The modified design is then verified for conformance to the various component specifications. This iterative process begins with a simple block diagram showing the components of interest and progresses to detailed timing diagrams, specifications, and timing analysis.
The Central Processing Unit (CPU)
The process of designing an embedded microcomputer system is mostly independent of the particular CPU that is used. The example design of this chapter is a relatively simple one that illustrates the design and analysis process in enough detail to show what needs to be done. Because the Intel 8031 microcontroller design has a simple bus interface, has brief timing specifications, uses SRAM, and incorporates relatively simple I/O on chip, it will be used to illustrate the critical design and analysis processes. Once the complete process is understood with this simple CPU, more advanced designs can be addressed with comparative ease.
The 8031 processor is a Harvard architecture with a multiplexed address and data bus. There are three address spaces: internal RAM, external data RAM, and external program ROM. The external program ROM and data RAM are