Fast and Effective Embedded Systems Design is a fast-moving introduction to embedded systems 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 to start. C/C++ programming is applied, with a step-by-step approach which allows you to get coding quickly. Once the basics are covered, the book progresses to some "hot" embedded issues - intelligent instrumentation, wireless and networked systems, digital audio and digital signal processing. In this new edition all examples and peripheral devices are updated to use the most recent libraries and peripheral devices, with increased technical depth, and introduction of the "mbed enabled" concept.
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 and techniques introduced, and considers applications in a wider context.
New Chapters on:
- Bluetooth and ZigBee communication
- Internet communication and control, setting the scene for the ‘Internet of Things’
- Digital Audio, with high-fidelity applications and use of the I2S bus
- Power supply, and very low power applications
- The development process of moving from prototyping to small-scale or mass manufacture, with a commercial case study.
- Updates all examples and peripheral devices to use the most recent libraries and peripheral products
- Includes examples with touch screen displays and includes high definition audio input/output with the I2S interface
- Covers the development process of moving from prototyping to small-scale or mass manufacture with commercial case studies
- Covers hot embedded issues such as intelligent instrumentation, networked systems, closed loop control, and digital signal processing
|Edition description:||New Edition|
|Product dimensions:||7.50(w) x 9.25(h) x (d)|
About the Author
Rob Toulson is Professor of Creative Industries at the University of Westminster. He holds a PhD in the field of digital signal processing (awarded by Anglia Ruskin University in 2004) and a first degree in Mechanical Engineering from Loughborough University (1999). Rob has a number of year’s industrial experience in digital signal analysis, control systems design, rapid prototyping, and model based design, as well as commercial experience in sound engineering and music production. His main focus is now in developing collaborative research between the technical and creative industries.Tim Wilmshurst is the author of Designing Embedded Systems with PIC Microcontrollers. He has been designing embedded systems since the early days of microcontrollers. For many years this was for Cambridge University, where he led a development team building original systems for research applications - for example in measurement of bullet speed, wind tunnel control, simulated earthquakes, or seeking a cure to snoring. Now he is Head of Electronic Systems at the University of Derby, where he aims to share his love of engineering design with his students.
Read an Excerpt
Fast and Effective Embedded Systems DesignApplying the ARM mbed
By Rob Toulson Tim Wilmshurst
NewnesCopyright © 2012 Rob Toulson and Tim Wilmshurst
All right reserved.
Chapter OneEmbedded 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.
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
Chapter 1. Embedded Systems, Microcontrollers, andARM
Part I. Essentials of Embedded Systems, Using the mbed
Chapter 2. Introducing the mbed
Chapter 3. Digital Input and Output
Chapter 4. Analog Output
Chapter 5. Analog Input
Chapter 6. Further Programming Techniques
Chapter 7. Starting with Serial Communication
Chapter 8. Liquid Crystal Displays
Chapter 9. Interrupts, Timers, and Tasks
Chapter 10. Memory and Data Management
Part II. Moving to Advanced and Specialist Applications
Chapter 11. Wireless Communication – Bluetooth and Zigbee
Chapter 12. Internet Communication and Control
Chapter 13. Working With Digital Audio
Chapter 14. Letting Go of the mbed Libraries
Chapter 15. Hardware Insights: Clocks, Resets, andPower Supply
Chapter 16. Developing Commercial Products Withmbed