Module 4
Module 4
Introduction:
https://www.mepits.com/tutorial/194/arm/arm.
ARM processors vs. Intel processors: When you purchase a processor you will get
to know that some of the designs use Intel Atom processors while the other uses ARM
architecture. These both processors are designed in a way for low-power
operation. They are created to give the mobile a long battery life. But they are both
based on different ideology. The ARM structure is made very simple and is intended
to keep the energy wastage to the minimum. Intel processors are made of complicated
designs to match the compatibility of the company‘s desktop and laptop CPU’s. ARM
processors are being used in the portable devices from a very long time but Intel has
just entered to this area. Intel is believed to have a serious competition with the ARM
technology. The power chips of ARM processors are relatively low in price, so if Intel
will have to reconsider their pricing strategies to compete with it. The entry of ARM
processors and Set
The ARM Instruction their wide
- ARM usage
University has forced
Program - V1.0 Intel to increase their efficiency.
Simulation is the process of using a simulation software (simulator) to verify the
functional correctness of a digital design that is modeled using a HDL (hardware
description language) like Verilog.
https://www.elprocus.com/difference-between-avr-arm-8051-and-pic-
microcontroller/.
http://www.firmcodes.com/difference-arm-microcontrollers/.
8051 microcontroller is an 8-bit family of microcontroller is developed by the Intel in the year
1981. This is one of the popular families of microcontroller are being used all across the world.
This microcontroller was moreover referred as “system on a chip” since it has 128 bytes of
RAM, 4Kbytes of a ROM, 2 Timers, 1 Serial port, and 4 ports on a single chip. The CPU can
also work for 8bits of data at a time since 8051 is an 8-bit processor. In case the data is bigger
than 8 bits, then it has to be broken into parts so that the CPU can process easily. Most
manufacturers contain put 4Kbytes of ROM even though the number of ROM can be exceeded
up to 64 K bytes.
PIC Microcontroller
AVR microcontroller was developed in the year of 1996 by Atmel Corporation. The structural
design of AVR was developed by the Alf-Egil Bogen and Vegard Wollan. AVR derives its name
from its developers and stands for Alf-Egil Bogen Vegard Wollan RISC microcontroller, also
known as Advanced Virtual RISC. The AT90S8515 was the initial microcontroller which was
based on the AVR architecture, though the first microcontroller to hit the commercial market
was AT90S1200 in the year 1997.
The current processor mode governs which of several banks is accessible. Each
mode can access
a particular set of r0-r12 registers
a particular r13 (the stack pointer, sp) and r14 (the link register, lr)
cpsr
spsr spsr spsr spsr spsr spsr
SP (R13): Stack Pointer. There is no stack in the ARM architecture. Even so, R13 is
usually reserved as a pointer for the program-managed stack
CPSR : Current Program Status Register. Holds the visible status register
SPSR : Saved Program Status Register. Holds a copy of the previous status register
while executing exception or interrupt routines
- It is copied back to CPSR on the return from the exception or interrupt
- No SPSR available in User or System modes
cpsr
spsr spsr spsr spsr spsr
N Z C V undefined I F T mode
f s x c
Flag
[Rn] Register
Address accessed is value found in Rn.
Example:
Memory
ldr r0, [r1] @ r0 *r1
.
.
.
r1 r0 Destination
0x200 0x200 0x5 0x5 Register
for ldr
.
.
Memory
.
Example: .
ldr r2, [r1, #12] @ r2 ← *(r1 + 12) .
r1 Destination
188 Register
for ldr
r2
200 27 27
Example:
ldr r2, [r0, r1] @ r2 ← *(r0 + r1)
Example:
ldr r0, [r1, r2, lsl #2] @ r0 ← *(r1 + r2*4)
Example:
ldr r2, [r1, #12]! @ r1 ← r1 + 12 then r2 ← *r1
Example:
ldr r2, [r0, r1]! @ r0 ← r0 + r1 then r2 ← *r0
Example:
ldr r2, [r0, r1, lsl #2]! @ r0 ← r0 + r1*4 then r2 ← *r0
Example:
str r2, [r1], +4 @ *r1 ← r2 then r1 ← r1 + 4
31 28 24 20 16 12 8 4 0
Cond
* Instead it has a barrel shifter which provides a mechanism to carry out shifts
as part of other instructions.
CF Destination 0
r1 r2
Base Destination
Register 0x200 0x200 0x5 0x5 Register
for LDR
r1
Base
Register 0x200 0x200
r1 Offset r0
Updated Source
Base 0x20c 12 0x5 Register
0x20c
Register for STR
0x200 0x5
r1
Original
Base 0x200
Register
* To auto-increment the base register to location 0x1f4 instead use:
• STR r0, [r1], #-12
* If r2 contains 3, auto-incremenet base register to 0x20c by multiplying
this by 4:
• STR r0, [r1], r2, LSL #2
* When used in a privileged mode, this does the load/store with user mode
privilege.
• Normally used by an exception handler that is emulating a memory
access instruction that would normally execute in user mode.
Cond 1 0 1 L Offset
0x418
SP r5 SP
r4 r5
r3 r4
r1 r3
r0 r1
Old SP Old SP r5 Old SP Old SP r0 0x400
r5 r4
r4 r3
r3 r1
r1 r0
SP r0 SP
0x3e8
1
Rn
temp
2 3
Memory
Rm Rd
Condition Field
* The ARM uses a pipeline in order to increase the speed of the flow of
instructions to the processor.
• Allows several operations to be undertaken simultaneously, rather than
serially.
ARM
ARM7TDMI
ARM decode
Instruction ThumbARM Reg Reg
Shift ALU
Fetch decompress Read Write
Reg Select
ARM9TDMI
ARM or Thumb
Instruction Inst Decode Memory Reg
Shift + ALU Write
Fetch Reg Reg Access
Decode Read
FETCH DECODE EXECUTE MEMORY WRITE
ARM11
Data Data
Address Cache Cache
1 2
Interrupt
Controller
nIRQ nFIQ
Peripherals I/O
ARM
Core
8 bit ROM
High Timer
Bandwidth AHB
APB
External
Bridge
Memory
Interface Keypad