Embedded Systems Circuits and Programming
eBook - ePub

Embedded Systems Circuits and Programming

  1. 891 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Embedded Systems Circuits and Programming

About this book

During the development of an engineered product, developers often need to create an embedded system—a prototype—that demonstrates the operation/function of the device and proves its viability. Offering practical tools for the development and prototyping phases, Embedded Systems Circuits and Programming provides a tutorial on microcontroller programming and the basics of embedded design.

The book focuses on several development tools and resources:

  • Standard and off-the-shelf components, such as input/output devices, integrated circuits, motors, and programmable microcontrollers
  • The implementation of circuit prototypes via breadboards, the in-house fabrication of test-time printed circuit boards (PCBs), and the finalization by the manufactured board
  • Electronic design programs and software utilities for creating PCBs
  • Sample circuits that can be used as part of the targeted embedded system
  • The selection and programming of microcontrollers in the circuit

For those working in electrical, electronic, computer, and software engineering, this hands-on guide helps you successfully develop systems and boards that contain digital and analog components and controls. The text includes easy-to-follow sample circuits and their corresponding programs, enabling you to use them in your own work. For critical circuits, the authors provide tested PCB files.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Embedded Systems Circuits and Programming by Julio Sanchez,Maria P. Canton in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Engineering. We have over one million books available in our catalogue for you to explore.

Information

Chapter 1
Real-Time Computing
1.0Ā Ā Defining the Embedded System
An embedded system can be defined as a computer system that performs one or more dedicated or specialized functions usually with Real-Time constraints. It is the digital controller that is embedded as part of system, which also includes other hardware and mechanical elements. A modern dishwasher contains an embedded control system. On the other hand, a general-purpose computer such as a PC is designed to meet a variety of user needs. The control system in the dishwasher does one task: wash dishes, while the PC on your desktop can be used in word processing, browsing the Web, balancing your checkbook, and many other applications.
Embedded systems are controlled by one or more digital processing devices, typically a microcontroller or digital signal processor (DSP). The key feature of the embedded system is that it is dedicated to a specific task. Sometimes a specialized or dedicated computer system, such as the one handling a dam, or the traffic in a major city, or the operation of a nuclear power plant, is considered an embedded system. Although it is a matter of semantics, we prefer to exclude specialized or dedicated computer systems from the embedded category. We also exclude devices based on nanotechnology because in this case it is the molecular size of the component that defines the system. But even excluding specialized computing devices and molecular-scale components, embedded systems can range widely in size and complexity; from handheld or portable devices such as a digital watch to complex controllers such as the one operating a space exploration robot.
A good example of an embedded system, as considered in this context, is a programmable thermostat controlling the operation of household air conditioning and heater systems. In real-time the thermostat receives information from a sensor that reads the house temperature at predetermined intervals. The controller logic then compares this temperature value with the one programmed for the current time-of-day and turns on or off the AC or the heater component as necessary.
1.1Ā Ā Embedded Systems History
One of the first recognizably modern embedded systems was the Apollo Guidance Computer, developed at the MIT Instrumentation Laboratory in 1961. It was the Apollo Guidance Computer that first explored the viability of monolithic integrated circuits which have because become commonplace. Another early embedded system was the Autonetics D-17 guidance computer for the Minuteman missile, which was based on transistors and contained a hard disk drive as its main memory. In 1996, the D-17 controller was replaced with a new computer that pioneered the development of integrated circuits. One result from these projects was the reduction in cost of the quad nand gate ICs from $1,000 each to less than $3. Commercial applications soon followed.
The invention and development of microcontrollers relates closely to the evolution of embedded systems. The integration of processing functions, memory, and programmable input and output operations in a single circuit has simplified the design and development of embedded systems, to the point that today it is difficult to find an embedded system that does not include at least one microcontroller. Furthermore, the low cost of microcontrollers compared to full-fledged computer ICs has further increased the type of applications for which embedded systems are commercially viable. All embedded systems discussed in this book contain a microcontroller although some systems also include other digital components that provide specialized functionality. For example, an embedded system that deals in Real-Time units (such as years, months, days-of-the-week, hours, minutes, and seconds) will typically include a Real-Time clock IC such as the NJU6355, which will furnish this functionality.
1.2Ā Ā Hardware Complexity
To the developer or engineer an embedded system consists of hardware and software. The hardware typically includes a circuit board that houses and interfaces the components, one or more integrated circuits that provide the processing capabilities (usually a microcontroller), and one or more input and output devices that communicate with the outside world. But not all embedded systems are stand alone devices. For example, an embedded system that turns on and off a stepper motor and controls its rotational speed and direction may be designed to communicate with another system that provides the logic and command signals. In this case the embedded motor control system is actually a component of a larger control system and does not contain a user interface, processing logic, or other command and control functions.
On the other hand, some embedded systems come close to the functionality of a conventional computer. For example, an embedded system may include a computer screen with a graphical user interface, several buttons and control devices, LEDs, network connections, or even a touch screen. In this case it is the fact that the embedded system is dedicated to a particular task that differentiates it from a computer. But keep in mind that there is no clear demarcation line between a sophisticated embedded system and a specialized computer. One is free to classify such borderline systems in either category. In this sense an ATM machine, with its complex processing and IO capabilities, can be considered either as an embedded system or as a specialized computer.
1.2.1Ā Ā Processor
It is virtually impossible to conceive of an embedded system that does not provide some processing, although, here again, the demarcation line is not always clear. For example, the circuit that operates a household doorbell often consists of a simple pushbutton control and a buzzer or bell. Pressing the pushbutton closes the circuit that activates the sound-producing element. Because there is no logic or processing such a doorbell circuit could hardly be classified as an embedded system. However, if we add a processor that selects a different sound pattern or chime according to the time of day, then the doorbell driver could be classified as an embedded system. Here, it is the presence of a processing operation that defines the system.
Embedded processors are usually microcontrollers although it is conceivable that an embedded system can be based on a microprocessor. The principal difference between the microprocessor and the microcontroller is that the latter includes peripheral functions that simplify its application and reduce the cost of the IC. Additionally, it is usually assumed that a microprocessor system contains more complex and powerful logic; however, the advent of the Digital Signal Processor (DSP) has also diminished this perception because some DSPs match or even exceed the processing power of microcomputers.
1.2.2Ā Ā Microcontrollers
In this book we do not cover embedded systems based on microprocessors or on DSPs because the complexity of such systems clearly exceeds our present scope and intention. But even excluding these high-end devices, dealing with the many sources, types, and complexity of currently available microcontrollers can be a daunting proposition. Chapter 5 contains an overview of microcontrollers from Intel, Microchip, Motorola, and Atmel often found in embedded systems. However, for space constraints and practical didactic considerations, in this book we limit our coverage to a few popular and well-supported microcontrollers from Microchip, all based on its mid-range architecture.
1.2.3Ā Ā Hardware and Software
The hardware components that can be found in an embedded system are difficult to enumerate. They include (but are not limited to) the following elements:
•  Circuit boards
•  Processors (usually one or more microcontrollers)
•  Transistors
•  Logic gates
•  Power supplies
•  Clocks and flip-flops
•  Frequency dividers, timers, and counters
•  Multiplexers and demultiplexers
•  Memories and data storage facilities
•  Communications controllers
•  Switches and keypads
•  LEDs, seven-segement LEDs, and LCDs
•  Motors and motor control devices
•  Sensors
•  Solenoids and actuators
•  AC converters and output devices
Books can be and have been written on many of these elements. In fact, titles on some of them (such as microcontrollers) fill several good-sized shelves. Fortunately, others are rather simple devices, and their understanding and use is straightforward and direct. For example, from an embedded systems developer point of view, there is not much more that can be done with an LED than to turn it on or off.
By a stretch of the imagination we can conceive of an embedded system that operates solely on the off-the-shelf logic contained in its digital devices. However, a more common scenario is that the processing operations of an embedded system must be customized by the developer to meet a specific design functionality. This means that a program must be developed for the system’s controller. The reference in this book’s title to circuits and programming indicates that its contents relate to both the physical electronics and the software component of an embedded system.
1.3Ā Ā Execution in Real-Time
Real-time or reactive computing refers to systems that are subject to a time constraint. By definition, a real-time computing system is one that interacts with the real world or that has timing requirements related to this interaction. In general, the response of a Real-Time system must take place within a specific time frame. For example, in order to be effective, the air-bag system in the steering wheel of a car must deploy within a certain time period after the event that activates it. If the air bag deploys earlier or later than this ideal moment, its action would be useless or even counterproductive. Note that the concept of execution in real-time does not mean that the system’s interaction must take place as fast as possible.
By definition a real-time system includes not only those that must execute within a temporal constraint, but also any system that interacts with the real world. In embedded systems this interaction with the real world usually takes place through sensors and actuators. For example, the doorbell system previously mentioned executes in Real-Time because it is expected that the buzzer or chime will sound within a short time after the pushbutton is depressed.
1.3.1Ā Ā Hard and Soft Real-Time Systems
Real-Time systems are often classified as hard and soft. Systems that must meet strict timing requirements are classified as hard while those in which there is a more flexible tolerance of the timing requirement are soft RTSs, (Real-Time Systems). In this context, the air-bag system mentioned previously completely fails if its strict timing requirement is not met; therefore, it is a hard RTS. The doorbell system, on the other hand, has a much larger tolerance in its timing requirement and can be classified as a soft RTS. The timeliness requirement is one of the main issues in the design of a hard real-time system, but must also be considered in soft RTSs.
Design considerations in Real-Time systems include the following topics:
•  Real-Time operating systems
•  Scheduling
•  Real-Time communications
•  Analysis of Real-Time components
•  Testing and debugging Real-Time systems
In this context our discussion of Real-Time systems is limited to specific circuits with a specific Real-Time constraint. Most of the topics listed above fall within the field of theoretical computer science.
Chapter 2
Circuit Fundamentals
2.1 Electrical Circuit
An electrical network is a collection of electrical elements that can include voltage sources, lines, connectors, resistors, inductors, capacitors, switches, controllers, and a host of other standard and special components. The circuit is a closed-loop electrical network that provides a return path for the current and that contains at least one active electronic component.
Electronic circuits are classified as analog, digital, or mixed-signal, the latter being a combination of the analog and digital types. Circuits contain discrete components often purchased off-the-shelf. These include but are not limited to resistors, capacitors, inductors, diodes, processors (such as microcontrollers), as well as input and output devices such as pushbuttons, toggle switches, light-emitting diodes, liquid crystal displays, actuators, and motors. During the development stage, the circuit components are typica...

Table of contents

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright Page
  5. Table of Contents
  6. Preface
  7. Chapter 1 – Real-Time Computing
  8. Chapter 2 – Circuit Fundamentals
  9. Chapter 3 – Logic Gates and Circuit Components
  10. Chapter 4 – Input and Output Devices
  11. Chapter 5 – From Circuit Schematics to PCB
  12. Chapter 6 – Introducing the Microcontroller
  13. Chapter 7 – Architecture and Instruction Set
  14. Chapter 8 – Embedded Systems Programming
  15. Chapter 9 – I/O Circuits and Programs
  16. Chapter 10 – PIC Interrupt System
  17. Chapter 11 – Timers and Counters
  18. Chapter 12 – LCD Hardware and Programming
  19. Chapter 13 – Analog-to-Digital and Real-Time Clocks
  20. Chapter 14 – Data EEPROM
  21. Chapter 15 – Stepper Motors
  22. Chapter 16 – Stepper Motor Circuit Components
  23. Chapter 17 – Unipolar Motor Circuits and Programs
  24. Chapter 18 – Constant-Voltage Bipolar Motor Controls
  25. Chapter 19 – Advanced Motor Controls
  26. Chapter 20 – Communications
  27. Appendix A – Resistor Color Codes
  28. Appendix B – Essential Electronics
  29. Appendix C – Numeric Data
  30. Appendix D – Character Data
  31. Appendix E – Digital Arithmetic and Conversions
  32. Appendix F – Mid-Range Instruction Set
  33. Appendix G – Printed Circuit Boards
  34. Appendix H – Additional Code
  35. Index