Designing Embedded Systems with PIC Microcontrollers: Principles and Applications [NOOK Book]


PIC microcontrollers are used worldwide in commercial and industrial devices. The 8-bit PIC which this book focuses on is a versatile work horse that completes many designs. An engineer working with applications that include a microcontroller will no doubt come across the PIC sooner rather than later. It is a must to have a working knowledge of this 8-bit technology.

This book takes the novice from introduction of embedded systems through to ...
See more details below
Designing Embedded Systems with PIC Microcontrollers: Principles and Applications

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$39.49 price
(Save 20%)$49.95 List Price


PIC microcontrollers are used worldwide in commercial and industrial devices. The 8-bit PIC which this book focuses on is a versatile work horse that completes many designs. An engineer working with applications that include a microcontroller will no doubt come across the PIC sooner rather than later. It is a must to have a working knowledge of this 8-bit technology.

This book takes the novice from introduction of embedded systems through to advanced development techniques for utilizing and optimizing the PIC family of microcontrollers in your device. To truly understand the PIC, assembly and C programming language must be understood. The author explains both with sample code and examples, and makes the transition from the former to the latter an easy one. This is a solid building block for future PIC endeavors.

New to the 2nd Edition:
*Include end of chapter questions/activities moving from introductory to advanced
*More worked examples
*Includes PowerPoint slides for instructors
*Includes all code snips on a companion web site for ease of use
*A survey of 16/32-bit PICs
*A project using ZigBee

*Covers both assembly and C programming languages, essential for optimizing the PIC
*Amazing breadth of coverage moving from introductory to advanced topics covering more and more complex microcontroller families
*Details MPLAB and other Microchip design tools
Read More Show Less

Product Details

  • ISBN-13: 9780080961842
  • Publisher: Elsevier Science
  • Publication date: 11/7/2009
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 2
  • Pages: 750
  • File size: 13 MB
  • Note: This product may take a few minutes to download.

Meet the Author

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 More Show Less

Read an Excerpt

Designing Embedded Systems with PIC Microcontrollers

Principles and applications
By Tim Wilmshurst


Copyright © 2007 Timothy Wilmshurst
All right reserved.

ISBN: 978-0-08-046814-3

Chapter One

Tiny computers, hidden control

We are living in the age of information revolution, with computers of astonishing power available for our use. Computers find their way into every realm of activity. Some are developed to be as powerful as possible, without concern for price, for high-powered applications in industry and research. Others are designed for the home and office, less powerful but also less costly. Another category of computer is little recognised, partly because it is little seen. This is the type of computer that is designed into a product, in order to provide its control. The computer is hidden from view, such that the user often doesn't know it's even there. This sort of product is called an embedded system, and it is what this book is about. Those little computers we generally call microcontrollers; it is one extended family of these that the book studies. In this chapter you will learn about:

• The meaning of the term 'embedded system'

• The microcontroller which lies at the heart of the embedded system

• The Microchip PIC® family

• A first PIC microcontroller, the 12F508

• An alternative microcontroller structure from Freescale.

1.1 The main idea – embedded systems in today's world

1.1.1 What is an embedded system?

The basic idea of an embedded system is a simple one. If we take any engineering product that needs control, and if a computer is incorporated within that product to undertake the control, then we have an embedded system. An embedded system can be defined as [Ref. 1.1]:

A system whose principal function is not computational, but which is controlled by a computer embedded within it.

These days embedded systems are everywhere, appearing in the home, office, factory, car or hospital. Table 1.1 lists some example products that are likely to be embedded systems, all chosen for their familiarity. While many of these examples seem very different from each other, they all draw on the same principles as far as their characteristics as an embedded system are concerned.

The vast majority of users will not recognise that what they are using is controlled by one or more embedded computers. Indeed, if they ever saw the controlling computer they would barely recognise it as such. Most people, after all, recognise computers by their screen, keyboard, disc drives and so on. This embedded computer would have none of those.

1.2 Some example embedded systems

Let's take a look at some example embedded systems, first from everyday life and then from the projects used to illustrate this book.

1.2.1 The domestic refrigerator

A simple domestic refrigerator is shown in Figure 1.1. It needs to maintain a moderately stable, low temperature within it. It does this by sensing its internal temperature and comparing that with the temperature required. It lowers the temperature by switching on a compressor. The temperature measurement requires one or more sensors, and then whatever signal conditioning and data acquisition circuitry that is needed. Some sort of data processing is required to compare the signal representing the measured temperature to that representing the required temperature and deduce an output. Controlling the compressor requires some form of electronic interface, which accepts a low-level input control signal and then converts this to the electrical drive necessary to switch the compressor power.

This process of control can be done by a conventional electronic circuit or it can be done by a small embedded computer. If used, the embedded computer could be designed simply to replicate the minimalist control process described above. Once a little computer is in place, however, there is tremendous opportunity for added value. With the signal in digital form and processing power now readily available, it is an easy step to add features like intelligent displays, more advanced control features, a better user control mechanism and so on.

Taking the idea of added value one step further, once an embedded computer is in place it is possible to network it to other computers, embedded or otherwise. This opens up big new horizons, allowing a small system to become a subset of a much larger system and to share information with that system. This is now happening with domestic products, like the refrigerator, as well as much more complex items.

The diagram of Figure 1.1, while specific for a fridge, actually represents very well the overall concept of an embedded system. There is an embedded computer, engaged in reading internal variables, and outputting signals to control the performance of the system. It may have human interaction (but in general terms does not have to) and it may have networked interaction. Generally, the user has no idea that there's a computer inside the fridge!

1.2.2 A car door mechanism

A very different example of an embedded system is the car door, as shown in Figure 1.2. Once again there are some sensors, some human interaction and a set of actuators that must respond to the requirements of the system. One set of sensors relates to the door lock and another to the window. There are two actuators, the window motor and the lock actuator.

It might appear that a car door could be designed as a self-contained embedded system, in a similar way to the fridge. Initially, one might even question whether it is worthy of any form of computer control whatsoever, as the functions seem so simple. Once again, by creating it as an embedded system, we see the opportunity to enhance functionality. Now we have the door status and actuators under electronic control, they can be integrated with the rest of the car. Central locking can be introduced or an alarm sounded if the door is not locked when the driver tries to pull away. There is therefore considerable advantage in having a network which links the humble actions of the door control to other functions of the car. We will see in later chapters that networked interaction is an important feature of the embedded system.

1.2.3 The electronic 'ping-pong'

This little game, shown in Figure 1.3, is one of several projects used to illustrate the material of this book. It is a game for two players, who each have a push button 'paddle'. Either player can start the game by pressing his/her paddle. The ball, represented by the row of eight LEDs (light-emitting diodes), then flies through the air to the opposing player, who must press his paddle only when the ball is at the end LED and at none other. The ball continues in play until either player violates this rule of play. Once this happens, the non-violating player scores and the associated LED is briefly lit up. When the ball is out of play, an 'out-of-play' LED is lit.

All the above action is controlled by a tiny embedded computer, a microcontroller, made by a company called Microchip [Ref. 1.2]. It takes the form of an 18-pin integrated circuit (IC), and has none of the visible features that one would normally associate with a computer. Nevertheless, electronic technology is now so advanced that inside that little IC there is a Central Processing Unit (CPU), a complex array of memories, and a set of timing and interface circuits. One of its memories contains a stored program, which it executes to run the game. It is able to read in as inputs the position of the switches (the player paddles) and calculate the required LED positions. It then has the output capability to actually power the LEDs to which it is connected. All of this computing action is powered from only two AAA cells!

1.2.4 The Derbot Autonomous Guided Vehicle

Another project used later in this book is the Derbot Autonomous Guided Vehicle (AGV), pictured in Figure 1.4. How do its features compare with the examples seen to date? Looking at the photograph, we can see from the front that it bristles with sensors and actuators. Two microswitch bump detectors sense if the Derbot hits an obstacle. An ultrasound detector, mounted on a servo actuator, is there with the aim of ensuring that the Derbot never needs to have an unexpected collision! Two light sensors on either side of the servo are used for light tracking applications – a third, not seen in the photo, is mounted at the rear. A further navigational option is a compass, so that direction can be determined from the earth's magnetic field. Locomotion is provided by two geared DC motors, while a sensor on each (again not seen in this picture) counts wheel revolutions to calculate actual distance moved. Steering is achieved by driving the wheels at different speeds. A piezo-electric sounder is included for the AGV to alert its human user. The Derbot is powered from six AA Alkaline cells, which it carries on a power pack almost directly above its wheels. Its block diagram is shown in Figure 1.5.

As with earlier examples, the Derbot operates as an embedded system, reading in values from its diverse sensors and computing outputs to its actuators. It is controlled by another Microchip microcontroller, hidden from view in the picture by the battery pack. This microcontroller is seemingly more powerful than the one in the ping-pong game, as it needs to interface with far more inputs and drive its outputs in a more complex way. Interestingly, as we shall see, the CPU of each microcontroller is the same. They are differentiated primarily by their interface capabilities. It is this difference that gives the Derbot microcontroller its aura of far greater power.

1.3 Some computer essentials

When designing embedded systems we usually need to understand in some detail the features of the embedded computer that we are working with. This is quite unlike working with a desktop computer used for word processing or computer-aided design, where the internal workings are skilfully hidden from the user. As a preliminary to developing our knowledge, let us undertake a rapid survey of some important computer features.

1.3.1 Elements of a computer

Figure 1.6 shows the essential elements of any computer system. Fundamentally, it must be able to perform arithmetic or logical calculations. This function is provided by the Central Processing Unit (CPU). It operates by working through a series of instructions, called a program, which is held in memory. 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. Many instructions cause mathematical and logical operations to occur. These take place in a part of the CPU called the ALU, the Arithmetic Logic Unit.

To be of any use the computer must be able to communicate with the outside world, and it does this through its input/output. On a personal computer this implies human interaction, through keyboard, VDU (Visual Display Unit) and printer. In an embedded system the communication is likely to be primarily with the physical world around it, through sensors and actuators.


Excerpted from Designing Embedded Systems with PIC Microcontrollers by Tim Wilmshurst Copyright © 2007 by Timothy 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.

Read More Show Less

Table of Contents

Chapter 1: Tiny Computers, Hidden Control
Chapter 2: Introducing the PIC 16 series, and the 16F84A
Chapter 3: Parallel Ports, Power Supply, and the Clock Oscillator
Chapter 4: Starting to Program - An Introduction to Assembler
Chapter 5: Building Assembler Programs
Chapter 6: Working with Time: Interrupts, Counters, and Timers Unchanged
Chapter 7: Larger Systems and the PIC 16883A
Chapter 8: The Human and Physical Interface
Chapter 9: Taking Timing Further
Chapter 10: Starting with Serial
Chapter 11: Data Acquisition and Manipulation
Chapter 12: Smarter Systems and the PIC 18FXX2
Chapter 13: The PIC 18FXX2 Peripherals
Chapter 14: Introducing C
Chapter 15: C and the Embedded Environment
Chapter 16: Acquiring and Using Data with C
Chapter 17: More C and the Wider C environment
Chapter 18: Multi-tasking and the Real Time Operating System
Chapter 19: The Salvo Real Time Operating System
Chapter 20: Connectivity and Networks
Chapter 21: A Zigbee project
Chapter 22: A Survey of 16/32 bit PIC Microcontrollers, and DSPIC
Appendix 1: The PIC 16 Series Instruction Set
Appendix 2: The Electronic Ping-Pong
Appendix 3: The Derbot AGV ? Hardware Design Details
Appendix 4: Some Basics of Autonomous Guided Vehicles
Appendix 5: PIC 18 Series Instruction Set (Non-Extended)
Appendix 6: Essentials of C
Read More Show Less

Customer Reviews

Average Rating 2
( 6 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 5 Customer Reviews
  • Anonymous

    Posted July 27, 2010

    No text was provided for this review.

  • Anonymous

    Posted August 2, 2012

    No text was provided for this review.

  • Anonymous

    Posted October 20, 2009

    No text was provided for this review.

  • Anonymous

    Posted September 23, 2012

    No text was provided for this review.

  • Anonymous

    Posted October 25, 2009

    No text was provided for this review.

Sort by: Showing all of 5 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)