ARM Microprocessor Systems
eBook - ePub

ARM Microprocessor Systems

Cortex-M Architecture, Programming, and Interfacing

Muhammad Tahir, Kashif Javed

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

ARM Microprocessor Systems

Cortex-M Architecture, Programming, and Interfacing

Muhammad Tahir, Kashif Javed

Book details
Book preview
Table of contents
Citations

About This Book

This book presents the use of a microprocessor-based digital system in our daily life. Its bottom-up approach ensures that all the basic building blocks are covered before the development of a real-life system. The ultimate goal of the book is to equip students with all the fundamental building blocks as well as their integration, allowing them to implement the applications they have dreamed up with minimum effort.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is ARM Microprocessor Systems an online PDF/ePUB?
Yes, you can access ARM Microprocessor Systems by Muhammad Tahir, Kashif Javed in PDF and/or ePUB format, as well as other popular books in Informatica & Tecnologia dell'informazione. We have over one million books available in our catalogue for you to explore.

Information

Publisher
CRC Press
Year
2017
ISBN
9781482259438

Chapter 1

Introduction

Overview

This chapter provides a general introduction to embedded systems and its building blocks. In particular, basic concepts related to microcontrollers, microprocessors, different types of memories, and the software tools required to work with microcontrollers are introduced. Different attributes that are the basis for microprocessor architecture classification are also discussed. We adopt a top-down approach in explaining these concepts.

1.1 Whatā€™s the Book About

If we look around at our surroundings for a short while, we will encounter systems being controlled by tiny computers everywhere. Air-conditioners, digital clocks, washing machines, cell phones, point-of-sale systems, and blood sugar measuring equipment are a few to name. These are examples of embedded systems. A system that performs a dedicated task, with the help of a computer embedded inside it, is named an embedded system. The tiny computer, which is comprised of components such as memory, central processing unit (CPU)1, and programmable input/output (I/O) interfaces is located on a single integrated chip and is termed a microcontroller. Since the advent of the first microcontroller in the early 1970s, more sophisticated architectures and organizations of the internal components have been developed in order to meet the needs of the advanced and complicated application requirements. A microcontroller or a microprocessor, at the heart of an embedded system, is integrated with other physical devices or modules to develop a standalone system.
The overall objective of this book is to familiarize the readers with the effectiveness of microcontrollers so that they can design and develop their own embedded systems for many different appealing applications. We have chosen ARMĀ® CortexĀ®-M family based microcontroller, which is based on a 32-bit ARM processor core from ARM Holdings. ARM Holdings designs a family of reduced instruction set computing (RISC) based processors as well as software development tools, but does not manufacture processor chips. Rather, it licenses the chip designs as well as ARM instruction set architectures to third parties to develop their own products. The Cortex-M processors are enriched with advanced features from the latest ARMv7-M architecture and have become the basis for many industry-leading 32-bit microcontrollers.
1We will use the words CPU and microprocessor interchangeably throughout this book.
The dilemma in learning as well as teaching such a practical subject is that it is very difficult to find a resource that provides a unified treatment of the subject, covering details related to processor architecture, assembly language programming as well as interfacing of external devices using different peripherals. There are few good books available for the Intel x86 architecture, which cover the above-mentioned three aspects. However, we could not find a similar treatment in the context of ARM architecture and this book is just the first step in that direction. The general concepts related to microcontrollers are described in this introductory chapter. The next two chapters provide details about the architecture of Cortex-M while Chapters 4 to 7 will deal with the ARM assembly language programming. In Chapters 8 to 12, the reader will learn how to interface external devices using different peripheral interfaces. We will use Cortex-M4 based microcontroller platform from Texas Instruments (TI). There are many other Cortex-M based microcontrollers available in the market from different vendors, e.g., ST Microelectronics and NXP, to name a few.
This chapter provides a general introduction to embedded systems and its building blocks. In particular, basic concepts related to microcontrollers, microprocessors, different types of memories, and the software tools required to work with microcontrollers are introduced. We adopt a top-down approach in this chapter in explaining these concepts.
Most of us use digital computers everyday. Broadly, a computer is a combination of two components namely hardware and software. Hard disk, CPU, memory (volatile also called RAM), CD-ROM and printers are a few examples of the hardware to name, which are considered part of a computer. We use software such as applications (one of the well-known applications these days is SKYPE, which allows different users to communicate over the Internet with each other) for various purposes and operating systems (Windows and Linux are two highly used operating systems) to manage the applications and computer hardware efficiently. Desktops and laptops are examples of such digital computer systems. A number of tasks can be accomplished with these general-purpose digital computers. Figure 1.1 shows the block diagram of a typical computer system.
Input devices, such as keyboard and mouse, allow a user to provide input to the computer system. The users can see useful information on output devices such as monitors and printers. These input/output (I/O) devices communicate with the CPU through different types of interfaces. The CPU carries out all kinds of processing and comprises three basic building blocks, namely, arithmetic logic unit (ALU), control unit and set of registers. The main memories are random access memory (RAM) and read-only memory (ROM). These memories are accessible directly from the processor. Different types of these memories and their related features will be discussed later in this chapter. Low access-time and random access are their major attributes. Hard disk is an example of the secondary memory and does not interact with the CPU directly. Its information access-time is relatively higher than that of the primary memories. The memory space requirements to store a large number of different applications makes it almost mandatory to use secondary memories, which usually have a relatively large amount of space compared to primary memories.
Images
Figure 1.1: Block diagram representation of a general purpose computer.

1.2 Embedded Systems

An embedded system is based on almost the same concepts as those employed by digital computers. A generic block diagram of an embedded system is shown in Figure 1.2. However, an embedded system is normally developed for a specific application to perform dedicated task(s). Their small size, low cost, and low power requirements have resulted in their widespread use. Examples include cell-phones and other handheld devices, blood pressure monitoring equipment used by doctors, digital multi-meters in the hands of electrical engineers, temperature and humidity measuring devices used by weather stations, to name a few. The requirements of these systems make processor, memory, and other interfaces to play a key role and are the building blocks for the tiny computer (also known as microcontroller) embedded inside a specific embedded system. The software is designed to handle a range of different tasks and is normally programmed to ROM memory, which is not accessible to the user of the embedded system. Similar to the hard disk, the ROM in embedded systems is employed to store programs permanently even when the power is turned off.
Images
Figure 1.2: A generic block diagram of an embedded system.
To further elucidate the relationship among embedded systems, microcontrollers, and microprocessors, letā€™s refer to Figure 1.3. From the system hardware perspective, an embedded system embeds a microcontroller inside it, which in turn contains a microprocessor core. This is a generic hierarchical view and will be elaborated further throughout this book.
Images
Figure 1.3: Embedded system hierarchy from a hardware design perspective.

1.2.1 Examples of Embedded Systems

No one can deny the importance of embedded systems. They are ubiquitous in our everyday lives. Our houses, cars, toys as well as offices are all equipped with these embedded systems making our lives more comfortable. We list some of the common application areas of embedded systems next.
  1. Applications in communication: Radios, telephones, cellular phones, answering machines, fax machines, wireless routers.
  2. Consumer electronics: Washing machine, clocks and watches, games and toys, remote controls, audio/video electronics.
  3. Automotive systems: Braking system, electronic ignition, locks, power windows and seats, collision avoidance.
  4. Commercial usage: ATM machines, bar code readers, elevator controllers.
  5. Medical treatments: Cancer treatments, dialysis machines, blood pressure measuring equipment, electrocardiography (ECG), etc.
  6. Industrial: Process automation, oil refineries, food processing plants, paper and board mills, etc.
  7. Military use: Missile guidance systems, global positioning systems, surveillance systems.

1.2.2 Design Parameters of Embedded Systems

In the design of an embedded system, there are many key factors that need to be considered. Broadly speaking, a good embedded system design will be the one that can achieve better trade-off between price and performance. While designing an embedded system, the factors that are of utmost importance are listed below.
  1. Power consumption
  2. Speed of execution
  3. System size and weight
  4. Performance accuracy
An embedded systemā€™s processing speed, the power it consumes, its size, and of course how accurately it performs the task assigned to it are those parameters which help a user in the selection process. Furthermore, we can also chalk down the parameters that are commonly used in the selection of a microcontroller and are listed below:
  1. Processing rate and processor size
  2. Different types of I/O devices that can be interfaced
  3. Memory size (RAM and ROM)
Now we introduce the microcontroller, which is next in the system hierarchy.

1.3 Microcontrollers

A microcontroller combines a microprocessor, read only memory (ROM), random access memory (RAM), and input/output (I/O) peripheral devices on a single chip. The microprocessor is similar to a human brain, which sends signals to control as well as information exchange with various subsystems. For this communication among subsystems, different buses are used. A bus is a collection of wires over which digital signals propagate in the form of 0s and 1s. Buses internal to the chip can be broadly categorized in three groups namely data, address, and control. Figure 1.4 shows the basic organization of a microcontroller, depicting how buses are used to connect memory and peripherals to the microprocessor. For the system shown in Figure 1.4, any memory location inside RAM or ROM memories as well as registers associated with different peripheral devices are identified by unique numbers called addresses. Address signals flow over the address bus. The size of the address bus decides the unique addresses generated by a microprocessor. The data bus carries the data. Increasing the size of the data bus allows more number of bits to be communicated between two subsystems. Control signals such as read/write inform whether the CPU is interested in reading some information or wants to write some information to the location whose address was generated over the address bus.
Images
Figure 1.4: Block diagram illustrating the basic building blocks of a microcontroller.
The capability of a microprocessor to process simultaneously a certain number of bits defines the type of microcontroller in terms of processing bits. For example, the first generation microcontrollers were based on 8-bit CPUs, which means that the processors inside those microcontrollers can process 8-bits simultaneously. The need for more processing power and advancements in technology have led to microcontrollers that can process 32 bits simultaneously. In addition, the reduction in the price gap between 8-bit and 32-bit microcontrollers has been a key factor in the popularity of 32-bit microcontrollers.
Another major component of a microcontroller is the general purpose peripheral device also called port, which provides a physical connection be...

Table of contents