CHAPTER 1 Introduction
What Is the ARM Cortex-M3 Processor?
The microcontroller market is vast, with over 20 billion devices per year estimated to be shipped in 2010. A bewildering array of vendors, devices, and architectures are competing in this market. The requirement for higher-performance microcontrollers has been driven globally by the industryās changing needs; for example, microcontrollers are required to handle more work without increasing a productās frequency or power. In addition, microcontrollers are becoming increasingly connected, whether by Universal Serial Bus (USB), Ethernet, or Wireless Radio, and hence the processing needed to support these communications channels and advanced peripherals is growing. Similarly, general application complexity is on the increase, driven by more sophisticated user interfaces, multimedia requirements, system speed, and convergence of functionalities.
The ARM Cortex-M3 processor, the first of the Cortex generation of processors released by ARM in 2006, was primarily designed to target the 32-bit microcontroller market. The Cortex-M3 processor provides excellent performance at low gate count and comes with many new features previously available only in high-end processors. The Cortex-M3 addresses the requirements for the 32-bit embedded processor market in the following ways:
- Greater performance efficiency, allowing more work to be done without increasing the frequency or power requirements
- Low power consumption, enabling longer battery life, especially critical in portable products including wireless networking applications
- Enhanced determinism, guaranteeing that critical tasks and interrupts are serviced as quickly as possible but in a known number of cycles
- Improved code density, ensuring that code fits in even the smallest memory footprints
- Ease of use, providing easier programmability and debugging for the growing number of 8-bit and 16-bit users migrating to 32-bit
- Lower-cost solutions, reducing 32-bit-based system costs close to those of legacy 8-bit and 16-bit devices and enabling low-end, 32-bit microcontrollers to be priced at less than US$1 for the first time
- Wide choice of development tools, from low-cost or free compilers to full-featured development suites from many development tool vendors
Microcontrollers based on the Cortex-M3 processor already compete head-on with devices based on a wide variety of other architectures. Designers are increasingly looking at reducing the system cost, as opposed to the traditional device cost. As such, organizations are implementing device aggregation, whereby a single, more powerful device can potentially replace three or four traditional 8-bit devices.
Other cost savings can be achieved by improving the amount of code reuse across all systems. Since Cortex-M3 processor-based microcontrollers can be easily programmed using the C language and are based on a well-established architecture, application code can be ported and reused easily, reducing development time and testing costs.
It is worthwhile highlighting that the Cortex-M3 processor is not the first ARM processor to be used to create generic microcontrollers. The venerable ARM7 processor has been very successful in this market, with partners such as NXP (Philips), Texas Instruments, Atmel, OKI, and many other vendors delivering robust 32-bit Microcontroller Units (MCUs). The ARM7 is the most widely used 32-bit embedded processor in history, with over 1 billion processors produced each year in a huge variety of electronic products, from mobile phones to cars.
The Cortex-M3 processor builds on the success of the ARM7 processor to deliver devices that are significantly easier to program and debug and yet deliver a higher processing capability. Additionally, the Cortex-M3 processor introduces a number of features and technologies that meet the specific requirements of the microcontroller applications, such as nonmaskable interrupts for critical tasks, highly deterministic nested vector interrupts, atomic bit manipulation, and an optional memory protection unit. These factors make the Cortex-M3
processor attractive to existing ARM processor users as well as many new users considering use of 32-bit MCUs in their products.
The Cortex-M3 Processor vs Cortex-M3-Based MCUs
The Cortex-M3 processor is the central processing unit (CPU) of a microcontroller chip. In addition, a number of other components are required for the whole Cortex-M3 processor-based microcontroller. After chip manufacturers license the Cortex-M3 processor, they can put the Cortex-M3 processor in their silicon designs, adding memory, peripherals, input/output (I/O), and other features. Cortex-M3 processor-based chips from different manufacturers will have different memory sizes, types, peripherals, and features. This book focuses on the architecture of the processor core. For details about the rest of the chip, please check the particular chip manufacturerās documentation.
Background of ARM and ARM Architecture
A Brief History
To help you understand the variations of ARM processors and architecture versions, letās look at a little bit of ARM history.
ARM was formed in 1990 as Advanced RISC Machines Ltd., a joint venture of Apple Computer, Acorn Computer Group, and VLSI Technology. In 1991, ARM introduced the ARM6 processor family, and VLSI became the initial licensee. Subsequently, additional companies, including Texas Instruments, NEC, Sharp, and ST Microelectronics, licensed the
ARM processor designs, extending the applications of ARM processors into mobile phones, computer hard disks, personal digital assistants (PDAs), home entertainment systems, and many other consumer products.
Nowadays ARM partners ship in excess of 2 billion ARM processors each year. Unlike many semiconductor companies, ARM does not manufacture processors or sell the chips directly. Instead, ARM licenses the processor designs to business partners, including a majority of the worldās leading semiconductor companies. Based on the ARM low-cost and power-efficient processor designs, these partners create their processors, microcontrollers, and system-on-chip solutions. This business model is commonly called intellectual property (IP) licensing.
In addition to processor designs, ARM also licenses systems-level IP and various software IP. To support these products, ARM has developed a strong base of development tools, hardware, and software products to enable partners to develop their own products.
Architecture Versions
Over the years, ARM has continued to develop new processors and system blocks. These include the popular ARM7TDMI processor and, more recently, the ARM1176TZ(F)-S processor, which is used in high-end applications such as smart phones. The evolution of features and enhancements to the processors over time has led to successive versions of the ARM architecture. Note that architecture version numbers are independent from processor names. For example, the ARM7TDMI processor is based on the ARMv4T architecture (the T is for Thumb instruction mode support).
The ARMv5E architecture was introduced with the ARM9E processor families, including the ARM926E-S and ARM946E-S processors. This architecture added āEnhancedā Digital Signal Processing (DSP) instructions for multimedia applications.
With the arrival of the ARM11 processor family, the architecture was extended to the ARMv6. New features in this architecture included memory system features and Single InstructionāMultiple Data (SIMD) instructions. Processors based on the ARMv6 architecture include the ARM1136J(F)-S, the ARM1156T2(F)-S, and the ARM1176JZ(F)-S.
Following the introduction of the ARM11 family, it was decided that many of the new technologies, such as the optimized Thumb-2 instruction set, were just as applicable to the lower-cost markets of microcontroller and automotive components. It was also decided that although the architecture needed to be consistent from the lowest MCU to the highest-performance application processor, there was a need to deliver processor architectures that best fit applications, enabling very deterministic and low gate count processors for cost-sensitive markets and feature-rich and high-performance ones for high-end applications.
Over the past several years, ARM extended its product portfolio by diversifying its CPU development, which resulted in the architecture version 7, or v7. In this version, the architecture design is divided into three profiles:
- The A profile, designed for high-performance open application platforms
- The R profile, designed for high-end embedded systems in which real-time performance is needed
- The M profile, designed for deeply embedded microcontroller-type systems
Letās look at these profiles in a bit more detail:
- A Profile (ARMv7-A): Application processors required to run complex applications such as high-end embedded operating systems (OSs), such as Symbian, Linux, and Windows Embedded, requiring the highest processing power, virtual memory system support with Memory Management Units (MMUs), and, optionally, enhanced Java support and a secure program execution environment. Example products include high-end mobile phones and electronic wallets for financial transactions.
- R Profile (ARMv7-R): Real-time, high-performance processors targeted primarily at the higher end of the real-time1 marketāthose applications, such as high-end breaking systems and hard drive controllers, in which high processing power and high reliability are essential and for which low latency is important.
- M Profile (ARMv7-M): Processors targeting low-cost applications in which processing efficiency is important and cost, power consumption, low interrupt la...