You are previewing Designing Embedded Hardware, 2nd Edition.
O'Reilly logo
Designing Embedded Hardware, 2nd Edition

Book Description

Embedded computer systems literally surround us: they're in our cell phones, PDAs, cars, TVs, refrigerators, heating systems, and more. In fact, embedded systems are one of the most rapidly growing segments of the computer industry today. Along with the growing list of devices for which embedded computer systems are appropriate, interest is growing among programmers, hobbyists, and engineers of all types in how to design and build devices of their own. Furthermore, the knowledge offered by this book into the fundamentals of these computer systems can benefit anyone who has to evaluate and apply the systems. The second edition of Designing Embedded Hardware has been updated to include information on the latest generation of processors and microcontrollers, including the new MAXQ processor. If you're new to this and don't know what a MAXQ is, don't worry--the book spells out the basics of embedded design for beginners while providing material useful for advanced systems designers. Designing Embedded Hardware steers a course between those books dedicated to writing code for particular microprocessors, and those that stress the philosophy of embedded system design without providing any practical information. Having designed 40 embedded computer systems of his own, author John Catsoulis brings a wealth of real-world experience to show readers how to design and create entirely new embedded devices and computerized gadgets, as well as how to customize and extend off-the-shelf systems. Loaded with real examples, this book also provides a roadmap to the pitfalls and traps to avoid. Designing Embedded Hardware includes:

  • The theory and practice of embedded systems

  • Understanding schematics and data sheets

  • Powering an embedded system

  • Producing and debugging an embedded system

  • Processors such as the PIC, Atmel AVR, and Motorola 68000-series

  • Digital Signal Processing (DSP) architectures

  • Protocols (SPI and I2C) used to add peripherals

  • RS-232C, RS-422, infrared communication, and USB

  • CAN and Ethernet networking

  • Pulse Width Monitoring and motor control

If you want to build your own embedded system, or tweak an existing one, this invaluable book gives you the understanding and practical skills you need.

Table of Contents

  1. Designing Embedded Hardware
  2. Dedication
  3. Preface
    1. Organization of This Book
    2. Using Code Examples
    3. Conventions
    4. SafariĀ® Enabled
    5. How to Contact Us
    6. Acknowledgments
  4. 1. An Introduction to Computer Architecture
    1. 1.1. Concepts
      1. 1.1.1. Processors
      2. 1.1.2. Basic System Architecture
        1. 1.1.2.1. Buses
        2. 1.1.2.2. Processor operation
        3. 1.1.2.3. ALU
      3. 1.1.3. Interrupts
        1. 1.1.3.1. Hardware interrupts
        2. 1.1.3.2. Software interrupts
      4. 1.1.4. CISC and RISC
      5. 1.1.5. Digital Signal Processors
    2. 1.2. Memory
      1. 1.2.1. RAM
      2. 1.2.2. ROM
        1. 1.2.2.1. EPROM
        2. 1.2.2.2. EEROM
        3. 1.2.2.3. Flash
    3. 1.3. Input/Output
    4. 1.4. DMA
      1. 1.4.1. Parallel and Distributed Computers
        1. 1.4.1.1. Introduction to parallel architectures
        2. 1.4.1.2. SIMD computers
        3. 1.4.1.3. MIMD computers
    5. 1.5. Embedded Computer Architecture
  5. 2. Assembly Language
    1. 2.1. Registers
    2. 2.2. Machine Code
    3. 2.3. Signed Numbers
    4. 2.4. Addressing Modes
      1. 2.4.1. Big-Endian and Little-Endian Addressing
    5. 2.5. Coding in Assembly
    6. 2.6. Disassembly
    7. 2.7. Position-Independent Code
    8. 2.8. Loops
    9. 2.9. Masking
    10. 2.10. Indexed Addressing
    11. 2.11. Stacks
    12. 2.12. Timing of Instructions
  6. 3. Forth/Open Firmware
    1. 3.1. Introducing Forth
    2. 3.2. String Words
    3. 3.3. Stack Manipulation
    4. 3.4. Creating New Words
    5. 3.5. Comments
    6. 3.6. if ... else
    7. 3.7. Loops
    8. 3.8. Data Structures
    9. 3.9. Interacting with Hardware and Memory
    10. 3.10. Forth Programming Guidelines
  7. 4. Electronics 101
    1. 4.1. Voltage and Current
    2. 4.2. Analog Signals
    3. 4.3. Power
    4. 4.4. Reading Schematics
    5. 4.5. Resistors
    6. 4.6. Capacitors
      1. 4.6.1. Types of Capacitors
    7. 4.7. RC Circuits
    8. 4.8. Inductors
    9. 4.9. Transformers
    10. 4.10. Diodes
    11. 4.11. Crystals
      1. 4.11.1. Clocks and Oscillators
        1. 4.11.1.1. Power versus speed
    12. 4.12. Digital Signals
    13. 4.13. Electrical Characteristics
      1. 4.13.1. Absolute Maximum Ratings
      2. 4.13.2. DC Characteristics
      3. 4.13.3. AC Characteristics and Timing
    14. 4.14. Logic Gates
    15. 4.15. The Importance of Reading the Datasheet
  8. 5. Power Sources
    1. 5.1. The Stuff Out of the Wall
    2. 5.2. Batteries
    3. 5.3. Low Power Design
    4. 5.4. Regulators
    5. 5.5. LM78xx Regulators
    6. 5.6. MAX603/MAX604 Regulators
    7. 5.7. MAX1615 Regulator
    8. 5.8. MAX724 Regulator
    9. 5.9. Electrical Noise and Interference
      1. 5.9.1. Minimize the Current Loop Area
      2. 5.9.2. Keep the Power Smooth
      3. 5.9.3. How to Destroy a Computer Without Really Trying
  9. 6. Building Hardware
    1. 6.1. Tools
      1. 6.1.1. Development Kits
      2. 6.1.2. Measurement Tools
      3. 6.1.3. In-Circuit Emulators
      4. 6.1.4. Construction Tools
    2. 6.2. Soldering
      1. 6.2.1. How to Solder
    3. 6.3. Quick Construction
      1. 6.3.1. Breadboarding
      2. 6.3.2. Wirewrapping
    4. 6.4. Printed-Circuit Boards
      1. 6.4.1. Laying Out a PCB
    5. 6.5. Building It
      1. 6.5.1. Powering Up for the First Time
      2. 6.5.2. Add in the Processor
      3. 6.5.3. Some Thoughts on Debugging
    6. 6.6. JTAG
  10. 7. Adding Peripherals Using SPI
    1. 7.1. Serial Peripheral Interface
      1. 7.1.1. SPI-Based Clock/Calendar
      2. 7.1.2. SPI-Based Digital Potentiometer
      3. 7.1.3. Adding Nonvolatile Data Memory with SPI
      4. 7.1.4. Adding a Parameter Memory Using SPI
  11. 8. Adding Peripherals Using I2C
    1. 8.1. Overview of I2C
    2. 8.2. Adding a Real-Time Clock with I2C
    3. 8.3. Adding a Small Display with I2C
  12. 9. Serial Ports
    1. 9.1. UARTs
    2. 9.2. Error Detection
    3. 9.3. Old Faithful: RS-232C
      1. 9.1.1. Shake Hands
      2. 9.1.2. Implementing an RS-232C Interface
      3. 9.1.3. Using a Serial Port as a Power Supply
    4. 9.4. RS-422
    5. 9.5. RS-485
  13. 10. IrDA
    1. 10.1. Introduction to IrDA
      1. 10.1.1. An IrDA Interface
      2. 10.1.2. Other Infrared Devices
  14. 11. USB
    1. 11.1. Introduction to USB
    2. 11.2. USB Packets
    3. 11.3. Physical Interface
    4. 11.4. Implementing a USB Interface
  15. 12. Networks
    1. 12.1. Controller Area Network (CAN)
    2. 12.2. Ethernet
      1. 12.2.1. Adding an Ethernet Interface
  16. 13. Analog
    1. 13.1. Amplifiers
    2. 13.2. Analog to Digital Conversion
      1. 13.2.1. Sample Rates
    3. 13.3. Interfacing an External ADC
    4. 13.4. Temperature Sensor
    5. 13.5. Light Sensor
      1. 13.5.1. Amplifying the Light Sensor
    6. 13.6. Accelerometer
    7. 13.7. Pressure Sensors
    8. 13.8. Magnetic-Field Sensor
    9. 13.9. Digital to Analog Conversion
    10. 13.10. PWM
    11. 13.11. Motor Control
      1. 13.11.1. Sensing Motor Speed
    12. 13.12. Switching Big Loads
  17. 14. The PIC Microcontrollers
    1. 14.1. A Tale of Two Processors
    2. 14.2. Starting Simple
      1. 14.2.1. Variable-Speed Oscillator
      2. 14.2.2. Power-on Reset
    3. 14.3. A Bigger PIC
    4. 14.4. PIC-Based Environmental Datalogger
    5. 14.5. Motor Control with a PIC
  18. 15. The AVR Microcontrollers
    1. 15.1. The AVR Architecture
    2. 15.2. The ATtiny15 Processor
      1. 15.2.1. Adding a Status LED
      2. 15.2.2. Switching Analog Signals
    3. 15.3. Downloading Code
    4. 15.4. A Bigger AVR
    5. 15.5. AVR-Based Datalogger
    6. 15.6. Bus Interfacing
      1. 15.6.1. AT90S8515 Memory Cycle
      2. 15.6.2. Bus Signals
      3. 15.6.3. Memory Maps and Address Decoding
      4. 15.6.4. PALs
      5. 15.6.5. Timing Analysis
      6. 15.6.6. Memory Management
        1. 15.6.6.1. Page mapping
        2. 15.6.6.2. Banked memory
        3. 15.6.6.3. Address translation
  19. 16. 68HC11
    1. 16.1. Architecture of the 68HC11
    2. 16.2. A Simple 68HC11-Based Computer
      1. 16.3. Address Decoding
  20. 17. MAXQ
    1. 17.1. Architectural Overview
    2. 17.2. Schematics
  21. 18. 68000-Series Computers
    1. 18.1. The 68000 Architecture
    2. 18.2. A Simple 68000-Based Computer
      1. 18.2.1. Reset Circuit
      2. 18.2.2. Address Decoder
      3. 18.2.3. I/O
      4. 18.2.4. Memory
      5. 18.2.5. Wait States
  22. 19. DSP-Based Controllers
    1. 19.1. The DSP56800
    2. 19.2. A DSP56805-Based Computer
      1. 19.2.1. Oscillator
      2. 19.2.2. Reset and Interrupts
      3. 19.2.3. External Memory
    3. 19.3. JTAG
  23. Index
  24. About the Author
  25. Colophon
  26. Copyright