SlideShare a Scribd company logo
EC8791- EMBEDDED AND REAL TIME
SYSTEMS
(R2017)
UNIT-2 ARM PROCESSOR AND
PERIPHERALS
1
SYLLABUS
ARM Architecture Versions – ARM Architecture
– Instruction Set – Stacks and Subroutines –
Features of the LPC 214X Family – Peripherals
– The Timer Unit – Pulse Width Modulation Unit
– UART – Block Diagram of ARM9 and ARM
Cortex M3 MCU.
2
ARM INTRODUCTION
• ARM is actually a family of RISC architectures
that have been developed over many years.
• ARM does not manufacture its own VLSI
devices; rather, it licenses its architecture to
companies who either manufacture the CPU
itself or integrate the ARM processor into a
larger system.
• The textual description of instructions, as
opposed to their binary representation, is called
an assembly language.
• ARM instructions are written one per line,
starting after the first column.
3
ARM ARCHITECTURE VERSIONS
• The ARM architecture has evolved significantly
and will continue to be developed in the future.
• Six major versions of the instruction set have been
defined to date, denoted by the version numbers
from 1 to 6.
– Of these, the first three versions including the original
26-bit architecture (the 32-bit architecture was
introduced at ARMv3) are now OBSOLETE.
– Other versions are Version 4, version 5 and
version6.Versions can be qualified with variant letters to
specify collections of additional instructions that are
included as an architecture extension.
4
Version 4 and Introduction toThumb
(T variant)
• The Thumb instruction set is a re-encoded subset
of the ARM instruction set.
• Thumb instructions execute in their own
processor state, with the architecture defining the
mechanisms required to transition between ARM
and Thumb states.
• The key difference is that Thumb instructions
are half the size of ARM instructions (16 bits
compared with 32 bits).
5
Version 5T
• Improved efficiency of ARM/Thumb
interworking.
• Count leading zeros (ARM only) and
software breakpoint (ARM and Thumb)
instructions added
• Additional options for coprocessor designers
(coprocessor support is ARM only)
• Tighter definition of flag setting on
multiplies (ARM and Thumb).
6
Version 6
• CPS, SRS and RFE instructions for improved
exception handling
• REV, REV16 and REVSH byte reversal
instructions
• SETEND for a revised endian (memory) model
LDREX and STREX exclusive access
instructions
7
Version 6
• SXTB, SXTH,UXTB, UXTH byte/half word
extend instructions
• A set of Single Instruction Multiple Data
(SIMD) media instructions
• Additional forms of multiply instructions with
accumulation into a 64-bit result.
8
ARM Architecture (ARM7 TDMI):
• T: Thumb, 16-bit instruction set
• D: on-chip Debug support, enabling the
processor to halt in response to a debug request
• M: enhanced Multiplier, yield a full 64-bit
result, high performance
• I: Embedded ICE hardware
The ARM architecture supports two basic types
of data:
– The standard ARM word is 32 bits long.
– The word may be divided into four 8-bit bytes.
9
Architecture of ARM7 Processor
10
ARM Registers
• ARM has 31 general-purpose 32-bit registers.
• At any one time, 16 of these registers are
visible.
• The other registers are used to speed up
exception processing.
• All the register specifies in ARM instructions
can address any of the 16 visible registers.
• The main bank of 16 registers is used by all
unprivileged code.
• These are the User mode registers.
11
Status registers
• All processor state other than the general-
purpose register contents is held in status
registers.
• Current program status register (CPSR) is the
register which is set automatically during
every arithmetic, logical, or shifting operation.
• The top four bits of the CPSR hold the
following useful information about the results
of that arithmetic/logical operation.
12
CISC Vs RISC
• Complex instruction set computers (CISC)
provides a variety of instructions that may
perform very complex tasks, such as string
searching;
• Reduced instruction set computers (RISC) tends
to provide somewhat fewer and simpler
instructions.
• The instructions were also chosen so that they
could be efficiently executed in pipelined
processors.
• RISC techniques can also use efficiently to
execute at least a common subset of CISC
instruction sets.
13
CISC Vs RISC
14
ARM Instruction Set
 Branch instructions
 Data-processing instructions on page
 Status register transfer instructions on page
 Load and store instructions on page
 Coprocessor instructions on page
 Exception-generating instructions on page.
15
Branch Instructions
• The B (branch) instruction is the basic mechanism
in ARM for changing the flow of control.
• The address that is the destination of the branch is
often called the branch target.
• Branches are PC-relative—the branch specifies the
offset from the current PC value to the branch
target.
• The offset is in words, but because the ARM is byte
addressable, the offset is multiplied by four (shifted
left two bits, actually) to form a byte address.
• Thus, the instruction B #400 will add 400 to the
current PC value.
16
Data-processing instructions on page
• The data-processing instructions perform
calculations on the general-purpose registers.
• There are five types of data-processing
instructions:
 Arithmetic/logic instructions
 Comparison instructions
 Single Instruction Multiple Data (SIMD) instructions
 Multiply instructions on page
 Miscellaneous Data Processing instructions on page.
17
Status register transfer instructions
• The status register transfer instructions
transfer the contents of the CPSR or an
SPSR to or from a general-purpose register.
Writing to the CPSR can:
 Set the values of the condition code flags
 Set the values of the interrupt enable bits
 Set the processor mode and state
 Alter the endianness of Load and Store
operations.
18
Load and store instructions
• Load-Store instructions are used to transfer
the Values between registers and memory.
– LDRB and STRB load and store bytes rather than
whole words, while LDRH and SDRH operate on
half-words and LDRSH extends the sign bit on
loading.
For example: LDR r0,[r1],STR r0,[r1]
• The following load and store instructions are
available:
– Load and Store Register
– Load and Store Multiple registers on page
– Load and Store Register Exclusive on page.
19
Coprocessor instructions
There are three types of coprocessor instructions:
Data-processing instructions
• These start a coprocessor-specific internal
operation.
Data transfer instructions
• These transfer coprocessor data to or from
memory. The address of the transfer is calculated
by the ARM processor.
Register transfer instructions
• These allow a coprocessor value to be
transferred to or from an ARM register, or a pair
of ARM registers.
20
Exception-generating instructions
Two types of instruction are designed to cause specific
exceptions to occur.
Software interrupt instructions
• SWI instructions cause a software interrupt exception to
occur.
• These are normally used to make calls to an operating system,
to request an OS-defined service.
• The exception entry caused by a SWI instruction also
changes to a privileged processor mode.
• This allows an unprivileged task to gain access to privileged
functions, but only in ways permitted by the OS.
21
Exception-generating instructions
Software breakpoint instructions
• BKPT instructions cause an abort exception to
occur.
• If suitable debugger software is installed on the
abort vector, an abort exception generated in
this fashion is treated as a breakpoint.
• If debug hardware is present in the system, it
can instead treat a BKPT instruction directly as
a breakpoint, preventing the abort exception
from occurring.
22
Stacks and Subroutines
Stack:
• The stack is an area of memory identified by the
programmer for temporary storage of
information.
• The stack is a LIFO (Last in First Out.)
structure.
• The stack normally grows backwards into
memory.
• In other words, the programmer defines the
bottom of the stack and the stack grows up into
reducing address range.
23
Stacks and Subroutines
• A subroutine is a group of instructions that will
be used repeatedly in different locations of the
program.
• Rather than repeat the same instructions several
times, they can be grouped into a subroutine
that is called from the different locations.
• In Assembly language, a subroutine can exist
anywhere in the code.
• However, it is customary to place subroutines
separately from the main program.
24
Stacks and Subroutines
• The 8085 has two instructions for dealing
with subroutines.
• The CALL instruction is used to redirect
program execution to the subroutine.
• The RTE instruction is used to return the
execution to the calling routine.
25
Features of the LPC 214X Family
• The LPC2141/2/4/6/8 microcontrollers are based on a
32/16 bit ARM7TDMI-S CPU with real-time emulation
and embedded trace support, that combines the
microcontroller with embedded high speed flash
memory ranging from 32 kB to 512 kB.
• A 128-bit wide memory interface and a unique
accelerator architecture enable 32-bit code execution at
the maximum clock rate.
• Various 32-bit timers, single or dual 10-bit ADC(s), 10-
bit DAC, PWM channels and 45 fast GPIO lines with
up to nine edge or level sensitive external interrupt pins
make these microcontrollers particularly suitable for
industrial control and medical systems.
26
Features
• 16/32-bit ARM7TDMI-S microcontroller in a tiny
LQFP64 package.
• 8 to 40 kB of on-chip static RAM and 32 to 512 kB of
on-chip flash program memory.
• 128 bit wide interface/accelerator enables high speed 60
MHz operation.
• In-System/In-Application Programming (ISP/IAP) via
on-chip boot-loader software.
• Single flash sector or full chip erase in 400 ms and
programming of 256 bytes in 1 ms.
• Embedded ICE RT and Embedded Trace interfaces offer
real-time debugging with the on-chip Real Monitor
software and high speed tracing of instruction execution.
27
Architecture of the LPC 214X Family
28
Peripherals – The Timer Unit
LPC214x Timer
Features:
• Timer/Counter0 and Timer/Counter1 are
functionally identical except for the
peripheral base address.
• A 32-bit Timer/Counter with a
programmable 32-bit Prescaler.
• Counter or Timer operation
29
LPC214x Timer
Features:
 Up to four 32-bit capture channels per timer, that
can take a snapshot of the timer value when inputs
signal transitions. A capture event may also
optionally generate an interrupt.
 Four 32-bit match registers that allow:
• Continuous operation with optional interrupt
generation on match.
• Stop timer on match with optional interrupt
generation.
• Reset timer on match with optional interrupt
generation.
30
Architecture LPC214x Timer
31
LPC214x Pulse Width Modulation
• Seven match registers allow up to 6 single
edge controlled or 3 double edge Controlled
PWM outputs, or a mix of both types.
• The match registers also allow:
– Continuous operation with optional interrupt
generation on match.
– Stop timer on match with optional interrupt
generation.
– Reset timer on match with optional interrupt
generation.
32
LPC214x Pulse Width Modulation
• Supports single edge controlled and/or
double edge controlled PWM outputs.
• Single edge controlled PWM outputs all go
high at the beginning of each cycle unless
the output is a constant low.
• Double edge controlled PWM outputs can
have either edge occur at any position
within a cycle.
• This allows for both positive going and
negative going pulses.
33
Architecture of the LPC214x PWM
34
LPC214x UART0
35
LPC214x UART1
36
Block Diagram of ARM9
37
ARM Cortex M3 MCU
38

More Related Content

PDF
Lecture 14 Properties of Fourier Transform for 2D Signal
VARUN KUMAR
 
PPTX
General register organization (computer organization)
rishi ram khanal
 
PPTX
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
JEEVANANTHAMG6
 
PPTX
Instruction Formats
RaaviKapoor
 
PPTX
Adaptive equalization
Kamal Bhatt
 
PDF
Implementation of FPGA Based Image Processing Algorithm using Xilinx System G...
IRJET Journal
 
PPTX
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
ShivangiSingh241
 
PPTX
block diagram of 8086
asrithak
 
Lecture 14 Properties of Fourier Transform for 2D Signal
VARUN KUMAR
 
General register organization (computer organization)
rishi ram khanal
 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
JEEVANANTHAMG6
 
Instruction Formats
RaaviKapoor
 
Adaptive equalization
Kamal Bhatt
 
Implementation of FPGA Based Image Processing Algorithm using Xilinx System G...
IRJET Journal
 
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
ShivangiSingh241
 
block diagram of 8086
asrithak
 

What's hot (20)

PDF
8085 microprocessor ramesh gaonkar
SAQUIB AHMAD
 
PPTX
Byte and string manipulation 8086
mpsrekha83
 
PPTX
Bus aribration
Saiyam Agrawal
 
PPTX
Booth’s algorithm.(a014& a015)
Piyush Rochwani
 
PPTX
Lecture 37
RahulRathi94
 
PPTX
Types of Addressing modes- COA
Ruchi Maurya
 
PPTX
Chapter 5: Cominational Logic with MSI and LSI
Er. Nawaraj Bhandari
 
PPT
CPU Register Organization.ppt
prathamgunj
 
PPTX
DMA Versus Polling or Interrupt Driven I/O
sathish sak
 
PPTX
Basic Computer Organization and Design
Aksum Institute of Technology(AIT, @Letsgo)
 
PPTX
Addressing modes of 8086
saurav kumar
 
DOCX
Flag register 8086 assignment
Zia3130
 
PPTX
Pipelining And Vector Processing
TheInnocentTuber
 
PPTX
ALGORITHMIC STATE MACHINES
Rabindranath Tagore University, Bhopal
 
PPT
Architecture of 8086 Microprocessor
Mustapha Fatty
 
PDF
Decimation in Time
SURAJ KUMAR SAINI
 
PPT
8086 pin details
AJAL A J
 
PDF
Interrupts of microprocessor 8085
Nilesh Bhaskarrao Bahadure
 
PDF
Control Unit Design
Vinit Raut
 
PPTX
Computer organization
ishapadhy
 
8085 microprocessor ramesh gaonkar
SAQUIB AHMAD
 
Byte and string manipulation 8086
mpsrekha83
 
Bus aribration
Saiyam Agrawal
 
Booth’s algorithm.(a014& a015)
Piyush Rochwani
 
Lecture 37
RahulRathi94
 
Types of Addressing modes- COA
Ruchi Maurya
 
Chapter 5: Cominational Logic with MSI and LSI
Er. Nawaraj Bhandari
 
CPU Register Organization.ppt
prathamgunj
 
DMA Versus Polling or Interrupt Driven I/O
sathish sak
 
Basic Computer Organization and Design
Aksum Institute of Technology(AIT, @Letsgo)
 
Addressing modes of 8086
saurav kumar
 
Flag register 8086 assignment
Zia3130
 
Pipelining And Vector Processing
TheInnocentTuber
 
ALGORITHMIC STATE MACHINES
Rabindranath Tagore University, Bhopal
 
Architecture of 8086 Microprocessor
Mustapha Fatty
 
Decimation in Time
SURAJ KUMAR SAINI
 
8086 pin details
AJAL A J
 
Interrupts of microprocessor 8085
Nilesh Bhaskarrao Bahadure
 
Control Unit Design
Vinit Raut
 
Computer organization
ishapadhy
 
Ad

Similar to EC8791 ARM Processor and Peripherals.pptx (20)

PDF
semester 6_arm processor basics Mod 3_part 1.pdf
lekhapankaj1
 
PPT
Digital circuits, including digital computers, are formed from binary circuits
RAJESHSKR
 
PPTX
Mod 3.pptx
lekha349785
 
PPTX
ARM introduction registers architectures
KNaveenKumarECE
 
PPT
ARMicrocontroller Memory and Exceptions,Traps.ppt
ECEHITS
 
PPTX
The sunsparc architecture
Taha Malampatti
 
PPT
ARM Architecture
Kshitij Gorde
 
PPTX
Arm processor
PrashantSingh056
 
PPTX
Introduction to arm processor
RAMPRAKASHT1
 
PPTX
WINSEM2022-23_BECE204L_TH_VL2022230500861_2023-02-10_Reference-Material-I.pptx
SoniBhavya
 
PPTX
Computer organization & ARM microcontrollers module 3 PPT
ChetanNaikJECE
 
PPT
20-ARM Design Philosophy, Overview of ARM architecture-10-04-2025.ppt
ll9273890
 
PPTX
It very good ppt because it is good ppt method
rameshkumar638260
 
PPTX
Arm architecture chapter2_steve_furber
asodariyabhavesh
 
PPTX
MPU Chp2.pptx
EE2k2016YasirJavaid
 
PPTX
Processors selection
Pradeep Shankhwar
 
PDF
Introduction to ARM Architecture
Racharla Rohit Varma
 
PDF
Explain briefly about the major enhancements in ARM processor archite.pdf
arjunenterprises1978
 
PPTX
mod1_arm_embedded_systems_ppt_2021_22_odd_oe.pptx
mithunkarthikb24
 
PPTX
unit 1ARM INTRODUCTION.pptx
KandavelEee
 
semester 6_arm processor basics Mod 3_part 1.pdf
lekhapankaj1
 
Digital circuits, including digital computers, are formed from binary circuits
RAJESHSKR
 
Mod 3.pptx
lekha349785
 
ARM introduction registers architectures
KNaveenKumarECE
 
ARMicrocontroller Memory and Exceptions,Traps.ppt
ECEHITS
 
The sunsparc architecture
Taha Malampatti
 
ARM Architecture
Kshitij Gorde
 
Arm processor
PrashantSingh056
 
Introduction to arm processor
RAMPRAKASHT1
 
WINSEM2022-23_BECE204L_TH_VL2022230500861_2023-02-10_Reference-Material-I.pptx
SoniBhavya
 
Computer organization & ARM microcontrollers module 3 PPT
ChetanNaikJECE
 
20-ARM Design Philosophy, Overview of ARM architecture-10-04-2025.ppt
ll9273890
 
It very good ppt because it is good ppt method
rameshkumar638260
 
Arm architecture chapter2_steve_furber
asodariyabhavesh
 
MPU Chp2.pptx
EE2k2016YasirJavaid
 
Processors selection
Pradeep Shankhwar
 
Introduction to ARM Architecture
Racharla Rohit Varma
 
Explain briefly about the major enhancements in ARM processor archite.pdf
arjunenterprises1978
 
mod1_arm_embedded_systems_ppt_2021_22_odd_oe.pptx
mithunkarthikb24
 
unit 1ARM INTRODUCTION.pptx
KandavelEee
 
Ad

Recently uploaded (20)

PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
DOCX
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PDF
JUAL EFIX C5 IMU GNSS GEODETIC PERFECT BASE OR ROVER
Budi Minds
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PDF
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
PDF
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
PPTX
easa module 3 funtamental electronics.pptx
tryanothert7
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
Ppt for engineering students application on field effect
lakshmi.ec
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
JUAL EFIX C5 IMU GNSS GEODETIC PERFECT BASE OR ROVER
Budi Minds
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
easa module 3 funtamental electronics.pptx
tryanothert7
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 

EC8791 ARM Processor and Peripherals.pptx

  • 1. EC8791- EMBEDDED AND REAL TIME SYSTEMS (R2017) UNIT-2 ARM PROCESSOR AND PERIPHERALS 1
  • 2. SYLLABUS ARM Architecture Versions – ARM Architecture – Instruction Set – Stacks and Subroutines – Features of the LPC 214X Family – Peripherals – The Timer Unit – Pulse Width Modulation Unit – UART – Block Diagram of ARM9 and ARM Cortex M3 MCU. 2
  • 3. ARM INTRODUCTION • ARM is actually a family of RISC architectures that have been developed over many years. • ARM does not manufacture its own VLSI devices; rather, it licenses its architecture to companies who either manufacture the CPU itself or integrate the ARM processor into a larger system. • The textual description of instructions, as opposed to their binary representation, is called an assembly language. • ARM instructions are written one per line, starting after the first column. 3
  • 4. ARM ARCHITECTURE VERSIONS • The ARM architecture has evolved significantly and will continue to be developed in the future. • Six major versions of the instruction set have been defined to date, denoted by the version numbers from 1 to 6. – Of these, the first three versions including the original 26-bit architecture (the 32-bit architecture was introduced at ARMv3) are now OBSOLETE. – Other versions are Version 4, version 5 and version6.Versions can be qualified with variant letters to specify collections of additional instructions that are included as an architecture extension. 4
  • 5. Version 4 and Introduction toThumb (T variant) • The Thumb instruction set is a re-encoded subset of the ARM instruction set. • Thumb instructions execute in their own processor state, with the architecture defining the mechanisms required to transition between ARM and Thumb states. • The key difference is that Thumb instructions are half the size of ARM instructions (16 bits compared with 32 bits). 5
  • 6. Version 5T • Improved efficiency of ARM/Thumb interworking. • Count leading zeros (ARM only) and software breakpoint (ARM and Thumb) instructions added • Additional options for coprocessor designers (coprocessor support is ARM only) • Tighter definition of flag setting on multiplies (ARM and Thumb). 6
  • 7. Version 6 • CPS, SRS and RFE instructions for improved exception handling • REV, REV16 and REVSH byte reversal instructions • SETEND for a revised endian (memory) model LDREX and STREX exclusive access instructions 7
  • 8. Version 6 • SXTB, SXTH,UXTB, UXTH byte/half word extend instructions • A set of Single Instruction Multiple Data (SIMD) media instructions • Additional forms of multiply instructions with accumulation into a 64-bit result. 8
  • 9. ARM Architecture (ARM7 TDMI): • T: Thumb, 16-bit instruction set • D: on-chip Debug support, enabling the processor to halt in response to a debug request • M: enhanced Multiplier, yield a full 64-bit result, high performance • I: Embedded ICE hardware The ARM architecture supports two basic types of data: – The standard ARM word is 32 bits long. – The word may be divided into four 8-bit bytes. 9
  • 10. Architecture of ARM7 Processor 10
  • 11. ARM Registers • ARM has 31 general-purpose 32-bit registers. • At any one time, 16 of these registers are visible. • The other registers are used to speed up exception processing. • All the register specifies in ARM instructions can address any of the 16 visible registers. • The main bank of 16 registers is used by all unprivileged code. • These are the User mode registers. 11
  • 12. Status registers • All processor state other than the general- purpose register contents is held in status registers. • Current program status register (CPSR) is the register which is set automatically during every arithmetic, logical, or shifting operation. • The top four bits of the CPSR hold the following useful information about the results of that arithmetic/logical operation. 12
  • 13. CISC Vs RISC • Complex instruction set computers (CISC) provides a variety of instructions that may perform very complex tasks, such as string searching; • Reduced instruction set computers (RISC) tends to provide somewhat fewer and simpler instructions. • The instructions were also chosen so that they could be efficiently executed in pipelined processors. • RISC techniques can also use efficiently to execute at least a common subset of CISC instruction sets. 13
  • 15. ARM Instruction Set  Branch instructions  Data-processing instructions on page  Status register transfer instructions on page  Load and store instructions on page  Coprocessor instructions on page  Exception-generating instructions on page. 15
  • 16. Branch Instructions • The B (branch) instruction is the basic mechanism in ARM for changing the flow of control. • The address that is the destination of the branch is often called the branch target. • Branches are PC-relative—the branch specifies the offset from the current PC value to the branch target. • The offset is in words, but because the ARM is byte addressable, the offset is multiplied by four (shifted left two bits, actually) to form a byte address. • Thus, the instruction B #400 will add 400 to the current PC value. 16
  • 17. Data-processing instructions on page • The data-processing instructions perform calculations on the general-purpose registers. • There are five types of data-processing instructions:  Arithmetic/logic instructions  Comparison instructions  Single Instruction Multiple Data (SIMD) instructions  Multiply instructions on page  Miscellaneous Data Processing instructions on page. 17
  • 18. Status register transfer instructions • The status register transfer instructions transfer the contents of the CPSR or an SPSR to or from a general-purpose register. Writing to the CPSR can:  Set the values of the condition code flags  Set the values of the interrupt enable bits  Set the processor mode and state  Alter the endianness of Load and Store operations. 18
  • 19. Load and store instructions • Load-Store instructions are used to transfer the Values between registers and memory. – LDRB and STRB load and store bytes rather than whole words, while LDRH and SDRH operate on half-words and LDRSH extends the sign bit on loading. For example: LDR r0,[r1],STR r0,[r1] • The following load and store instructions are available: – Load and Store Register – Load and Store Multiple registers on page – Load and Store Register Exclusive on page. 19
  • 20. Coprocessor instructions There are three types of coprocessor instructions: Data-processing instructions • These start a coprocessor-specific internal operation. Data transfer instructions • These transfer coprocessor data to or from memory. The address of the transfer is calculated by the ARM processor. Register transfer instructions • These allow a coprocessor value to be transferred to or from an ARM register, or a pair of ARM registers. 20
  • 21. Exception-generating instructions Two types of instruction are designed to cause specific exceptions to occur. Software interrupt instructions • SWI instructions cause a software interrupt exception to occur. • These are normally used to make calls to an operating system, to request an OS-defined service. • The exception entry caused by a SWI instruction also changes to a privileged processor mode. • This allows an unprivileged task to gain access to privileged functions, but only in ways permitted by the OS. 21
  • 22. Exception-generating instructions Software breakpoint instructions • BKPT instructions cause an abort exception to occur. • If suitable debugger software is installed on the abort vector, an abort exception generated in this fashion is treated as a breakpoint. • If debug hardware is present in the system, it can instead treat a BKPT instruction directly as a breakpoint, preventing the abort exception from occurring. 22
  • 23. Stacks and Subroutines Stack: • The stack is an area of memory identified by the programmer for temporary storage of information. • The stack is a LIFO (Last in First Out.) structure. • The stack normally grows backwards into memory. • In other words, the programmer defines the bottom of the stack and the stack grows up into reducing address range. 23
  • 24. Stacks and Subroutines • A subroutine is a group of instructions that will be used repeatedly in different locations of the program. • Rather than repeat the same instructions several times, they can be grouped into a subroutine that is called from the different locations. • In Assembly language, a subroutine can exist anywhere in the code. • However, it is customary to place subroutines separately from the main program. 24
  • 25. Stacks and Subroutines • The 8085 has two instructions for dealing with subroutines. • The CALL instruction is used to redirect program execution to the subroutine. • The RTE instruction is used to return the execution to the calling routine. 25
  • 26. Features of the LPC 214X Family • The LPC2141/2/4/6/8 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with real-time emulation and embedded trace support, that combines the microcontroller with embedded high speed flash memory ranging from 32 kB to 512 kB. • A 128-bit wide memory interface and a unique accelerator architecture enable 32-bit code execution at the maximum clock rate. • Various 32-bit timers, single or dual 10-bit ADC(s), 10- bit DAC, PWM channels and 45 fast GPIO lines with up to nine edge or level sensitive external interrupt pins make these microcontrollers particularly suitable for industrial control and medical systems. 26
  • 27. Features • 16/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package. • 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory. • 128 bit wide interface/accelerator enables high speed 60 MHz operation. • In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. • Single flash sector or full chip erase in 400 ms and programming of 256 bytes in 1 ms. • Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real Monitor software and high speed tracing of instruction execution. 27
  • 28. Architecture of the LPC 214X Family 28
  • 29. Peripherals – The Timer Unit LPC214x Timer Features: • Timer/Counter0 and Timer/Counter1 are functionally identical except for the peripheral base address. • A 32-bit Timer/Counter with a programmable 32-bit Prescaler. • Counter or Timer operation 29
  • 30. LPC214x Timer Features:  Up to four 32-bit capture channels per timer, that can take a snapshot of the timer value when inputs signal transitions. A capture event may also optionally generate an interrupt.  Four 32-bit match registers that allow: • Continuous operation with optional interrupt generation on match. • Stop timer on match with optional interrupt generation. • Reset timer on match with optional interrupt generation. 30
  • 32. LPC214x Pulse Width Modulation • Seven match registers allow up to 6 single edge controlled or 3 double edge Controlled PWM outputs, or a mix of both types. • The match registers also allow: – Continuous operation with optional interrupt generation on match. – Stop timer on match with optional interrupt generation. – Reset timer on match with optional interrupt generation. 32
  • 33. LPC214x Pulse Width Modulation • Supports single edge controlled and/or double edge controlled PWM outputs. • Single edge controlled PWM outputs all go high at the beginning of each cycle unless the output is a constant low. • Double edge controlled PWM outputs can have either edge occur at any position within a cycle. • This allows for both positive going and negative going pulses. 33
  • 34. Architecture of the LPC214x PWM 34
  • 37. Block Diagram of ARM9 37
  • 38. ARM Cortex M3 MCU 38