Академический Документы
Профессиональный Документы
Культура Документы
UNIT – 2
ARM7 Processor Fundamentals: ARM Architecture, Registers, current
program status register, pipeline, exceptions, interrupts and vector table,
core extensions. Introduction to ARM Instruction Set: Data Processing
Instructions, Branch Instructions.
UNIT – 3
Introduction to ARM7 Instruction Set: Load Store Instructions, Software Interrupt
Instruction, Program Status Register Instructions, Loading Constants, and Conditional
Execution.
Introduction to the THUMB Instruction set: Thumb register usage, ARM7 –
Thumb Interworking, other branch instructions, Data Processing Instructions, Single
register Load – Store Instructions, Multiple register Load Store Instructions, Stack
Instructions, and Software Interrupt Instruction.
UNIT – 4
Interrupts & Exception Handling in ARM7: Exception Handling Interrupts,
Interrupt handling schemes, Design of system using GPIOs (LCD interface, 4 x 4
Keypad), Timers.
UNIT – 5
Embedded/Real – Time Operating System Concepts: Architecture of the Kernel,
Tasks & Task Scheduler, and Interrupt service Routine.
I/O peripherals: ADC, DAC, UART, SPI.
Textbooks:
1. Shibu K V, “Introduction to Embedded Systems”, 2nd Edition, McGraw Hill
Education, 2009.
2. Andrew N. Sloss, “ARM system Developers Guide”, Elsevier, 1st Edition, 2008.
ARM history
ARM was developed at Acorn Computer Limited of Cambridge ,
England between 1983 and 1985.
ARM Cores
• Licensed to partners to develop and fabricate new Micro-controllers
• Soft Core
• Founded in November 1990
• Spun out of Acorn Computers Designs
• Load/store
architecture
• A large array of
uniform registers
• Fixed-length 32-bit
instructions
• 3-address
instructions
• When accessing external random access memory the processor
must go though the memory device, indicated by the device
name M.
The shifter has other control inputs coming from instruction register.
Shift field in the instruction controls the operation of the barrel
shifter.
• The ALU has two 32-bits inputs. The first comes from the
register file while the other comes from the shifter.
Data types and Instruction sets
31 24 23 16 8 0
15 7
8-bit Byte
16-bit Half word
32-bit word
■ Register r14 is called the link register (lr) and is where the
core puts the return address whenever it calls a subroutine.
The ARM core uses the cpsr to monitor and control internal operations.
The cpsr is a dedicated 32-bit register and resides in the register file.
• The cpsr is divided into four fields, each 8 bits wide: flags, status,
extension, and control.
• In current designs the extension and status fields are reserved
for future use.
• The control field contains the processor mode, state, and
interrupt mask bits.
• The flags field contains the condition flags.
Interrupt Disable bits.
I = 1: Disables the IRQ.
F = 1: Disables the FIQ.
Condition code flags
N = Negative result from ALU T Bit
Z = Zero result from ALU Architecture xT only
C = ALU operation Carried out T = 0: Processor in ARM state
V = ALU operation oVerflowed T = 1: Processor in Thumb state
Mode bits
Specify the processor mode
Processor modes
• The processor mode determines
which registers are active and the
access rights to the cpsr register itself.
Supervisor mode is the mode that the processor is in after reset and is
generally the mode that an operating system kernel operates in.
System mode is a special version of user mode that allows full read-
write access to the cpsr.
• Another important feature is that the cpsr is not copied into the
spsr when a mode change is forced due to a program writing
directly to the cpsr. The saving of the cpsr only occurs when an
exception or interrupt is raised.
Processor Modes
ARM has seven basic operation modes
Mode changes by software control or external
interrupts
Privileged Modes
Most programs operate in user mode. ARM has
other privileges operating modes which are used to
handle exceptions, supervisor calls (software
interrupt), and system mode.
More access rights to memory systems and
coprocessors.
Current operating mode is defined by
CPSR[4:0].
Exceptions, Interrupts, and the Vector Table
Vector table
Interrupt
handlers
code
Interrupts
Exception Return
Once the exception has been handled, the user task
is normally resumed
The sequence is
– Any modified user registers must be restored from the
handler’s stack
– CPSR must be restored from the appropriate SPSR
– PC must be changed back to the relevant instruction
address
The last two steps happen atomically as part of a
single instruction
Conditional Execution
• Conditional execution controls whether or not the core will
execute an instruction.
In the first cycle the core fetches the ADD instruction from memory.
In the second cycle the core fetches the SUB instruction and decodes the
ADD instruction.
In the third cycle, both the SUB and ADD instructions are moved along the
pipeline. The ADD instruction is executed, the SUB instruction is decoded,
and the CMP instruction is fetched.
This procedure is called filling the pipeline. The pipeline allows the core to
execute an instruction every cycle
• Execution of a branch or direct modification of pc causes ARM
core to flush its pipeline
• There are three hardware extensions ARM wraps around the core:
cache and tightly coupled memory,
memory management, and
the coprocessor interface.
Cache and Tightly Coupled Memory
More than one coprocessor can be added to the ARM core via the
coprocessor interface.