Professional Documents
Culture Documents
www.vjece.blogspot.in
Embedded Systems
with
ARM 7 Controller (LPC 2148 )
Embedded Daemons
ww.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Syllabus
Programming Concepts
GPIO
Introduction to ARM
Embedded Systems
Difference between uC & uP
Difference between RISC & CISC
Instruction Queue
Instruction Pipeline
ARM Architecture
Serial Protocol
UART - 12 Hrs
Assembly Language
Working with QEMU
Sample Assembly Programs
Interrupt Programming
LPC2148 Microcontroller
Features of LPC2148
Block diagram of LPC2148
Pin diagram of LPC2148
Architectural overview
On-chip flash program memory
On-chip static RAM 6 Hrs
Timers
Real Time Clock
Embedded Daemons
www.vjece.blogspot.in
Session 1
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Systems
Combination of hardware and software
that performs a specific task.
Is a system built to perform its duty,
completely or partially independent of
human intervention.
Is specially designed to perform a few
tasks in the most efficient way.
Interacts with physical elements in our
environment, e.g. controlling and driving a
motor, sensing temperature
Embedded Daemons
www.vjece.blogspot.in
Embedded Systems
Characteristics
Specific Purpose
Very strict memory
limitations
Processor
limitations
Speed limitations
Cost Limitations
Accuracy & Timing
constraints
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
uC & uP
Micro Controllers
Specific Purpose
CPU with some
fixed RAM, ROM &
other peripherals
embedded in a
single chip
Clock speed is low
Cost is less
Micro Processors
General Purpose
Just the CPU with no
additional
peripherals within
the IC
Clock speed is
generally high
Cost is also high
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Atmel'sAVRarchitecture
Microchip'sPICarchitectur
e
Texas Instruments
MSP430architecture
Intel's8051architecture
Zilog'sZ80architecture
Western Design
Center's65816architectur
e
Hitachi'sSuperHarchitectu
re
Axis
Communications'ETRAX
CRISarchitecture
Power
Architecture(formerlyPow
erPC)
EnSilica'seSiRISCarchitecture
Milkymistarchitecture
Inmos'Transputerarchitec
tures
Embedded Daemons
www.vjece.blogspot.in
Reduced Instruction
Set Computing
Less number of
Instructions
Fixed Width
Instructions
Micro Instructions
Less CPU Cycles
Instruction Pipeline
Concept
Simplified Instructions
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Instruction Queue
Stores one or more instructions
Embedded Daemons
www.vjece.blogspot.in
Instruction Queue
Stores one or more instructions
Embedded Daemons
www.vjece.blogspot.in
Instruction Pipeline
Parallel execution of multiple instructions
Reads consecutive instruction from memory while previous
instruction are executed in various stages of pipeline
Pipeline Strategy
Instruction pipelining is similar to the use of an assembly line in a
manufacturing plant. An assembly line takes advantage of the
fact that a product goes through various staged of production.
By laying the production process out in an assembly line,
products at various stages can be worked on simultaneously. This
process is also referred to as pipelining, because, as in a pipeline,
new inputs are accepted at one end before previously accepted
inputs appear as outputs at the other end.
To apply this concept to instruction execution, we must recognize
that , in fact , an instruction has a number of stages.
Embedded Daemons
www.vjece.blogspot.in
Instruction Pipeline
Embedded Daemons
www.vjece.blogspot.in
Session 2
Embedded Daemons
www.vjece.blogspot.in
ARM Architecture
ARM Processor Core is a key
component of many successful 32-bit
embedded systems.
ARM 1 Prototype in 1985
Over 1 billion ARM Processors being
shipped- by the end of 2001
ARM Core- Not a single core, but
whole family of design shares similar
design & common instruction set.
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Registers
Embedded Daemons
www.vjece.blogspot.in
CPSR
Current Program Status Register
Embedded Daemons
www.vjece.blogspot.in
FIQ
High Priority interrupt is raised
IRQ
Low priority interrupt is raised
Supervisor
Most Privileged
Abort
Invalid memory access
Undef
Handles Undef Instructions
System
Most Priviledged
Embedded Daemons
www.vjece.blogspot.in
Processor Modes
Embedded Daemons
www.vjece.blogspot.in
Interrupts
ARM defines interrupt as special type of
Exception
Interrupt Requests
Interrupts are at Heart of Embedded
Systems
Interrupt handlers
Embedded Daemons
www.vjece.blogspot.in
Exception handling
A software routine that executes when an
exception occurs
Data Abort exception will have a Data Abort
Handler
Handler first determines the cause of
exception and then services the exception
Servicing takes place either within the handler
or by branching to a specific service routine
Reset Exception is a special exception
because it initializes the embedded system
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Vector Table
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Procedure of Handling
Interrupt
An IRQ or FIQ exception causes the processor hardware to
go through a standard procedure (provided the interrupts
are not masked):
1. The processor changes to a specific interrupt request mode,
which reflects the interrupt
being raised.
2. The previous modes cpsr is saved into the spsr of the new
interrupt request mode.
3. The pc is saved in the lr of the new interrupt request mode.
4. Interrupt/s are disabledeither the IRQ or both IRQ and FIQ
exceptions are disabled
in the cpsr. This immediately stops another interrupt request of the
same type being
raised.
5. The processor branches to a specific entry in the vector table.
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
ARM Applications
Embedded Daemons
www.vjece.blogspot.in
ARM 7 applications
Embedded Daemons
www.vjece.blogspot.in
M9 applications
Embedded Daemons
www.vjece.blogspot.in
ARM11 applications
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
ARM CortexR
Embedded Daemons
www.vjece.blogspot.in
Session 3
Embedded Daemons
www.vjece.blogspot.in
Assembly Language
Instructions in text form
Flow of Assembly language program
.s .o .out [ Linux ]
C Program Flow
.c (Preprocessor) .i (Compiler) .s
(Assembler ) .o (Linker ).out
Embedded Daemons
www.vjece.blogspot.in
QEMU
QEMU is a FAST! processor emulator using dynamic
translation to achieve good emulation speed.
QEMU has two operating modes:
Full system emulation. In this mode, QEMU emulates a full
system (for example a PC), including one or several
processors and various peripherals. It can be used to
launch different Operating Systems without rebooting the
PC or to debug system code.
User mode emulation. In this mode, QEMU can launch
processes compiled for one CPU on another CPU. It can be
used to launch the Wine Windows API emulator (
http://www.winehq.org) or to ease cross-compilation and
cross-debugging.
QEMU Limitations
Assembly Introduction
Commonly Used Instructions
Moving
MOV , MVN
Arithmetic
ADD, SUB, MUL
Branch
B, BX, BL
Logical
AND, ORR, EOR
Compare
CMP
Embedded Daemons
www.vjece.blogspot.in
Sample Programs
Demo using QEMU
Using Linux Terminal
Some basic Linux commands
VI Editor Working
Sample Programs
Session 4
Embedded Daemons
www.vjece.blogspot.in
LPC 2148
32 / 16 ARM7TDMI-s CPU
Embedded High Speed Flash Memory
Tiny size & low Power Consumption
LQFP64 package
128 bit wide Interface/ Accelerator enables High Speed 60 MHz
Operation
Blend of Serial Communication Interface
USB 2.0 Full Speed Device
Multiple UARTS
SPI, SSP
IIC
32 bit Timers
10 bit ADC, DAC
PWM Channels
45 Fast GPIO Lines
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Applications in General
Industrial control
Medical systems
Access control
Point-of-sale
Communication gateway
Embedded soft modem
General purpose applications
Embedded Daemons
www.vjece.blogspot.in
Development board
schematic
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in
Session 5
Programming in ARM
Embedded Daemons
www.vjece.blogspot.in
Embedded Daemons
www.vjece.blogspot.in