Fast and Effective Embedded Systems Design: Applying the ARM mbed

Fast and Effective Embedded Systems Design: Applying the ARM mbed

by Tim Wilmshurst, Rob Toulson
Fast and Effective Embedded Systems Design: Applying the ARM mbed

Fast and Effective Embedded Systems Design: Applying the ARM mbed

by Tim Wilmshurst, Rob Toulson

eBook

$44.99  $59.95 Save 25% Current price is $44.99, Original price is $59.95. You Save 25%.

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Fast and Effective Embedded Systems Design is a fast-moving introduction to embedded system design, applying the innovative ARM mbed and its web-based development environment. Each chapter introduces a major topic in embedded systems, and proceeds as a series of practical experiments, adopting a "learning through doing" strategy. Minimal background knowledge is needed. C/C++ programming is applied, with a step-by-step approach which allows the novice to get coding quickly. Once the basics are covered, the book progresses to some "hot" embedded issues – intelligent instrumentation, networked systems, closed loop control, and digital signal processing.

Written by two experts in the field, this book reflects on the experimental results, develops and matches theory to practice, evaluates the strengths and weaknesses of the technology or technique introduced, and considers applications and the wider context. Numerous exercises and end of chapter questions are included.

  • A hands-on introduction to the field of embedded systems, with a focus on fast prototyping
  • Key embedded system concepts covered through simple and effective experimentation
  • Amazing breadth of coverage, from simple digital i/o, to advanced networking and control
  • Applies the most accessible tools available in the embedded world
  • Supported by mbed and book web sites, containing FAQs and all code examples
  • Deep insights into ARM technology, and aspects of microcontroller architecture
  • Instructor support available, including power point slides, and solutions to questions and exercises

Product Details

ISBN-13: 9780080977690
Publisher: Elsevier Science
Publication date: 07/03/2012
Sold by: Barnes & Noble
Format: eBook
Pages: 400
File size: 8 MB

About the Author

Rob Toulson is Professor of Creative Industries: Commercial Music at the University of Westminster, as well as Founder and Director of RT Sixty Ltd., a company that develops innovative applications for the audio-visual and music industries. Professor Toulson is a world-leading expert in audio-visual mobile applications, digital signal processing, embedded systems, musical acoustics, music production and interactive sound design.

Read an Excerpt

Fast and Effective Embedded Systems Design

Applying the ARM mbed
By Rob Toulson Tim Wilmshurst

Newnes

Copyright © 2012 Rob Toulson and Tim Wilmshurst
All right reserved.

ISBN: 978-0-08-097769-0


Chapter One

Embedded Systems, Microcontrollers and ARM

Chapter Outline 1.1 Introducing Embedded Systems 3 1.1.1 What is an Embedded System? 3 1.1.2 An Example Embedded System 5 1.2 Microprocessors and Microcontrollers 6 1.2.1 Some Computer Essentials 7 1.2.2 The Microcontroller 8 1.3 Development Processes in Embedded Systems 9 1.3.1 Programming Languages: What is so Special about C/C++? 9 1.3.2 The Development Cycle 10 1.4 The World of ARM 11 1.4.1 A Little History 12 1.4.2 Some Technical Detail: What does this RISC Word Mean? 13 1.4.3 The Cortex Core 14 Chapter Review 15 Quiz 15 References 16

1.1 Introducing Embedded Systems

1.1.1 What is an Embedded System?

We are all familiar with the idea of a desktop or laptop computer, and the amazing processing that they can do. These computers are general purpose; we can get them to do different things at different times, depending on the application or program we run on them. At the very heart of such computers is a microprocessor, a tiny and fantastically complicated electronic circuit which contains the core features of a computer. All of this is fabricated on a single slice of silicon, called an integrated circuit (IC). Some people, particularly those who are not engineers themselves, call these circuits microchips, or just chips.

What is less familiar to many people is the idea that instead of putting a microprocessor in a general-purpose computer, it can also be placed inside a product which has nothing to do with computing, like a washing machine, toaster or camera. The microprocessor is then customized to control that product. The computer is there, inside the product; but it cannot be seen, and the user probably does not even know it is there. Moreover, those add-ons that are normally associated with a computer, like keyboard, screen or mouse, are nowhere to be seen. Such products are called embedded systems, because the computer that controls them is embedded right inside. Because they tend to focus on control, in many cases the microprocessors used in embedded systems develop different characteristics from the ones used in more general-purpose machines. They are called microcontrollers. Although much less visible than their microprocessor cousins, microcontrollers sell in far greater volume and their impact has been enormous. To the electronic and system designer they offer huge opportunities.

Embedded systems come in many forms and guises. They are extremely common in the home, the motor vehicle and the workplace. Most modern domestic appliances, like washing machines, dishwashers, ovens, central heating and burglar alarms, are embedded systems. The motor car is full of them, in engine management, security (for example, locking and antitheft devices), air-conditioning, brakes, radio, and so on. They are found across industry and commerce, in machine control, factory automation, robotics, electronic commerce and office equipment. The list has almost no end, and it continues to grow.

Figure 1.1 expresses the embedded system as a simple block diagram. There is a set of inputs from the controlled system. The embedded computer, usually a microcontroller, runs a program dedicated to this application, permanently stored in its memory. Unlike the general-purpose desktop computer, which runs many programs, this is the only program it ever runs. Based on information supplied from the inputs, the microcontroller computes certain outputs, which are connected to things like actuators within the system. The actual electronic circuit, along with any electromechanical components, is often called the hardware; the program running on it is often called the software. Aside from all of this, there may also be interaction with a user, for example via keypad and display, and there may be interaction with other subsystems elsewhere, although neither of these is essential to the general concept. One other variable will affect all that we do in embedded systems, and this is time, represented as a dominating arrow which cuts across the figure. We will need to be able to measure time, make things happen at precisely predetermined times, generate data streams or other signals with a strong time dependence, and respond to unexpected things in a timely fashion.

This chapter introduces or reviews many concepts relating to computers, microprocessors, microcontrollers and embedded systems. It does this in overview form, to give a platform for further learning. We return to most concepts in later chapters, building on them and adding detail. More details can also be found in Reference 1.1.

1.1.2 An Example Embedded System

A snack vending machine is a good example of an embedded system. One is represented in Figure 1.2, in block diagram form. At its heart is a single microcontroller. As the diagram shows, this accepts a number of input signals, from the user keypad, the coin-counting module and the dispensing mechanism itself. It generates output signals dependent on those inputs.

A hungry customer may approach the machine and start jabbing at the buttons or feeding in coins. In the first case, the keypad sends signals back to the microcontroller, so that it can recognize individual keys pressed and then hook these key values together to decipher a more complex message. The coin-counting module will also send information on the amount of money paid. The microcontroller will attempt to make deductions from the information it receives and will output status information on the liquid crystal display. Has a valid product been selected? Has enough money been paid? If yes, then it will energize an actuator to dispense the product. If no, it will display a message asking for more money or a re-entry of the product code. A good machine will be ready to give change. If it does dispense, there will be sensors on the mechanism to ensure that the product is available, and finally that the action is complete. These are shown in the diagram as gate position sensors. A bad machine (and haven't we all met these?) will give annoying or useless messages on its display, demand more money when you know you've given the right amount, or leave that chocolate bar you desperately want teetering on a knife-edge, not dropping down into the dispensing tray.

What has been described so far is a fairly conventional machine. We can, however, take it further. In modern vending systems there might be a mobile communications feature which allows the vending machine to report directly to the maintenance team if a fault is diagnosed; they will then come and fix the fault. Similarly, the machine might report stock levels through mobile or Internet communications to allow the service team to visit and replenish whenever supplies run low.

This simple example reflects exactly the diagram of Figure 1.1. The microcontroller accepts input variables, makes calculations and decisions with this, and generates outputs in response. It does this in a timely manner, and correct use of time is implicit in these actions. There is in this case a user interface, and in a modern machine there is a network interface. While the above paragraphs seem to be describing the physical hardware of the system, in fact it is all controlled by the software that the designer has written. This runs in the microcontroller and determines what the system actually does.

1.2 Microprocessors and Microcontrollers

Let us go back to the microcontroller, which sits at the heart of any embedded system. As the microcontroller is in essence a type of computer, it will be useful for us to get a grasp on basic computer details. We do this in complete overview here, but return to some of these features in later chapters.

1.2.1 Some Computer Essentials

Figure 1.3 shows the essential elements of any computer system. As its very purpose for existence, a computer can perform arithmetic or logical calculations. It does this in a digital electronic circuit called the arithmetic logic unit (ALU). The ALU is placed within a larger circuit, called the central processing unit (CPU), which provides some of the supporting features that it needs. The ALU can undertake a number of simple arithmetic and logic calculations. Which one it does depends on a code which is fed to it, called an instruction. Now we are getting closer to what a computer is all about. If we can keep the ALU busy, by feeding it a sensible sequence of instructions, and also pass it the data it needs to work on, then we have the makings of a very useful machine indeed.

The ability to keep feeding the ALU with instructions and data is provided by the control circuit which sits around it. It is worth noting that any one of these instructions performs a very simple function. However, because the typical computer runs so incredibly fast, the overall effect is one of very great computational power. The series of instructions is called a program, normally held in an area of memory called program memory. This memory needs to be permanent. If it is, then the program is retained indefinitely, whether power is applied or not, and it is ready to run as soon as power is applied. Memory like this, which keeps its contents when power is removed, is called non-volatile memory. The old-fashioned name for this is read only memory (ROM). This latter terminology is still sometimes used, even though it is no longer accurate for new memory technology. The control circuit needs to keep accessing the program memory, to find out what the next instruction is. The data that the ALU works on may be drawn from the data memory, with the result placed there after the calculation is complete. Usually this is temporary data. This memory type therefore need not be permanent, although there is no harm if it is. Memory that loses its contents when power is removed is called volatile memory. The old-fashioned name for this type of memory is random access memory (RAM). This terminology is still used, although it conveys little useful information.

To be of any use, the computer must be able to communicate with the outside world, and it does this through its input/output (I/O). On a personal computer this implies human interaction, through things like the keyboard, visual display unit (VDU) and printer. In an embedded system, at least a simple one, the communication is likely to be primarily with the physical world around it, through sensors and actuators. Data coming in from the outside world might be quickly transferred to the ALU for processing, or it might be stored in data memory. Data being sent out to the outside world is likely to be the result of a recent calculation in the ALU.

Finally, there must be data paths between each of these main blocks, as shown by the block arrows in the diagram. These are collections of wires, which carry digital information in either direction. One set of wires carries the data itself, for example from program memory to the CPU; this is called the data bus. The other set of wires carries address information and is called the address bus. The address is a digital number that indicates which place in memory the data should be stored in, or retrieved from. The wires in each of the data and address buses could be tracks on a printed circuit board or interconnections within an IC.

One of the defining features of any computer is the size of its ALU. Simple, old processors were 8 bit, and some of that size still have useful roles to play. This means that, with their 8 bits, they can represent a number between 0 and 255. (Check Appendix A if you are unfamiliar with binary numbers.) More recent machines are 32 or 64 bit. This gives them far greater processing power, but adds to their complexity. Given an ALU size, it generally follows that many other features take the same size, for example memory locations, data bus, and so on.

As already suggested, the CPU has an instruction set, which is a set of binary codes that it can recognize and respond to. For example, certain instructions will require it to add or subtract two numbers, or store a number in memory. Many instructions must also be accompanied by data, or addresses to data, on which the instruction can operate. Fundamentally, the program that the computer holds in its program memory and to which it responds is a list of instructions taken from the instruction set, with any accompanying data or addresses that are needed. Such code is sometimes called machine code, to distinguish it from other versions of the program that we may also develop.

(Continues...)



Excerpted from Fast and Effective Embedded Systems Design by Rob Toulson Tim Wilmshurst Copyright © 2012 by Rob Toulson and Tim Wilmshurst. Excerpted by permission of Newnes. All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

Table of Contents

1 EMBEDDED SYSTEMS, MICROCONTROLLERS and ARM 2 INTRODUCING the MBED 3. DIGITAL INPUT and OUTPUT 4. ANALOG OUTPUT 5. ANALOG INPUT 6 FURTHER PROGRAMMING TECHNIQUES 7. STARTING with SERIAL COMMUNICATIONS 8. LIQUID CRYSTAL DISPLAYS 9. INTERRUPTS, TIMERS and TASKS 10 MEMORY and DATA MANAGEMENT 11 An INTRODUCTION to DIGITAL SIGNAL PROCESSING 12 ADVANCED SERIAL COMMUNICATIONS 13 An INTRODUCTION to CONTROL SYSTEMS 14 LETTING GO of the MBED LIBRARIES 15 EXTENSION PROJECTS APPENDIX A: SOME NUMBER SYSTEMS APPENDIX B: SOME C ESSENTIALS APPENDIX C: MBED TECHNICAL DATA APPENDIX D: PARTS LIST APPENDIX E: The TERA TERM TERMINAL EMULATOR

What People are Saying About This

From the Publisher

A complete education in embedded system programming and hardware design, applying the innovative ARM mbed and its development ecosystem

From the B&N Reads Blog

Customer Reviews