Arm Show

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 38

Asatoma sat gamaya Tamasoma jyotir gamaya Mrityorma amrutam gamaya

EMBEDDED SYSTEM DEVELOPMENT USING ARM PROCESSOR

M.SELVAM, M.Sc.,D.IT.,M.Phil.,(M.E.)

LECTURER, DEPT. OF ELECTRONICS & COMMUNICATION SYSTEMS KARPAGAM UNIVERSITY COIMBATORE 641 021
SELVAM 4 April 2013

System : is a way of working, organizing or doing one or many tasks according to a fixed plan, program, or set of rules.

An Embedded System is one that has computer hardware with software embedded in it as one of its most important component. It is a dedicated computer based system for an application or product. It may be either an independent system or a part of a larger system.
SELVAM 4 April 2013

Hardware : Microprocessor or Microcontroller or DSP with its supporting circuits.

Software : The application software may perform concurrently the series of tasks or multiple tasks.

RTOS : The Real Time Operating System that supervises the application software and provides a mechanism to let the processor run a process as per scheduling and do the context switch between the various tasks.

SELVAM

4 April 2013

Power Supply, Reset and Oscillator circuit

Input Devices, Interfacing/ Driving circuits Program Memory / Data memory

Processor

Timers Interrupt Controller

Serial Comm. Port

Parallel Ports

Outputs Interfacing / Driving Circuits


4 SELVAM 4 April 2013

System Application Specific Circuits

Abacus : first mechanical calculator Babylonians 500 B.C used up to 1642 (Pascal invented gear teeth) Electrical age : 1800 electric motors (Faraday) used to drive gears of mechanical computers up to 1970 Vacuum tubes (1930) replaced mechanical parts. ENIAC : first general purpose computer (1946) 17000 vacuum tubes, 500 miles of wires, 30 ton weight. Programmable by rewiring. Transistor : 1948 Bell labs semiconductor Advent. IC : 1958 Jack Kilby Texas Instruments RTL : 1960 100s 1000s of transistor in a single chip. Mini computer were placed for automation expensive & bulky the basic hardwire was logic gates, flip flops, counters, multiplexers etc.,

SELVAM

4 April 2013

Microprocessor : 1970 New dimension was provided for digital

system designers. The advantages are : 1. Cheaper and smaller( Number of ICs are replaced by single chip) 2. Minimum development time ( Drawings are reduced) 3. Increased flexibility ( expansions, modifications, improvements can be achieved by changing program or ROM ) 4. Reliability ( single chip replaces large number of logic devices since interconnections are reduced maintenance also minimum )

SELVAM

4 April 2013

Microprocessor Evolution : Intel 4004 : First MP 4 bit 4090 x 4 memory 45 instructions 50KIPS- requires additional circuits. Three separate buses- 72 instructions- 500 KIPS 64 KB

Intel 8080 :

Intel 8085 :

Additional interrupts 3 to 5 MHz serial interface

Motorola 6800 : 1974 two accumulators index and relative addressing

Zilog Z80 :
types.

More registers additional non mask able interrupts 2 independent flags 158 instructions

SELVAM

4 April 2013

* Intel 8086

: 16 bit 2.5 MIPS 1MB BIU & EU MUL & DIV

Zilog Z8000 : 8 MB 16 16bit regs. can be used as 32 & 64

bit
Motorola 68000 : First MP having 32 bit Regs. two 16 bit ALU

to 8MHz 16MB 8 external interrupts 6 data types : improved version of 8086 on chip PPI

Intel 80186

Intel 80286
Intel 80386

: designed for multitasking 16MB 4 MIPS

: 1986 first 32 bit MP 4GB - UNIX & multitasking applications - requires co- processor

SELVAM

4 April 2013

Intel 80486

: 1989 includes co-processor

8KB cache 50 MIPS

Intel Pentium : 1993 64bit MP -110 MIPS super scalar technology

separate cache for data and code- 2


ARM11

ALU with separate pipeline

: 32 bit RISC MP DSP extensions MMX supporting - consumer devices includes 2.5G & 3G mobile phones PDAs Digital camera IP and broadband modem etc., - 400 to 1200 MIPS

IBM Power PC 750 : 32bit RISC core 64 bit data bus 32 bit address

bus 500 MHz low power JTAG interface

SELVAM

4 April 2013

MC : is a integrated chip that has the processor, memory and several other hardware units. These form the micro computer part of the embedded system. Criteria for choosing a Microcontroller :

1. It must meet the computing needs of the task. 8bit/16bit/ 32bit speed packaging power consumption amount of RAM ROM number of IO pins cost etc.,
2. Availability of software development tools such as assemblers, compilers, debuggers, simulators, emulators etc., This will reduce the product development time. 3. Wide availability and reliable sources in needed quantities both now and in the future.
10 SELVAM 4 April 2013

* Intel 8051 : 1981 8bit 128 RAM -4KB ROM two timers 1 serial port four parallel ports six interrupts etc,.
Intel 8052 : 256 RAM 8K ROM 3 timers 8 interrupts etc., Intel 8031 : ROM less version of 8051 Intel 8751 : UV EPROM version of 8051 Atmel AT89C51 : the flash ROM version of 8051 Dallas Semiconductor DS5000 : the NV RAM version of 8051 Philips P89C51 : 6clock/12clock mode extended features such as

ADC, DAC, PWM etc.,


Cygnal : High speed high cost CPU 100 MIPS 5ADC 8 IO ports

JTAC voltage comparators 6 Timers 2 USARTS CAN CCP


SELVAM

11

4 April 2013

Microchip PIC Microcontrollers :

RISC core versatile choice for specific need - 8 to 64 pin count 62 MCs in 16Fxxx series - world number II bestseller IDE user friendly PIC 12CXXX : 12 bit instructions 512 / 1024 x 12 flash memory 25 / 41B RAM 6 IO pins one 8 bit timer 4MHz speed PIC16F84a : 4024 x 14 flash memory 68 B RAM 64 B EEPROM RAM 13 IO one 8 bit timer max. 20 MHz PIC 16F873 : 4096 X 14 flash 128 EEPROM RAM 192B RAM 22 IO- 28 pin 5 ch 10 bit ADC 2 PWM one 16 bit timer two 8bit timer USART I2C CCP etc.,

12

SELVAM

4 April 2013

PIC 16F876 : 8192 X 14 flash 256 EEPROM 368 B RAM


PIC 16F874 : 4096 X 14 flash 33 IO 40 pins 8 ch 10 bit ADC PIC 16F877 : 8192 X 14 flash - 33 IO 40 pins PIC 17CXXX & PIC 18CXXX : high speed CPU 40MHz 16 bit instructions CAN controller transmit, receive buffers filters etc., Other popular MCs : Motorola M68HC11, M68HC12,M68HC16 Taxas Instruments MSP430 Samsung SAM8 Zilog Z80 etc., AND FINALLY WE ENTERING ARM FAMILY

13

SELVAM

4 April 2013

The software is the most important aspect, the brain of the Embedded Systems. It may be classified as follows,

* Coding of software in Machine Codes


* Software in processor specific assembly language * Software in high level language * Software for device drivers and device management using operating system an

* Software design for scheduling multiple tasks and devices using an RTOS

14

SELVAM

4 April 2013

Software in machine codes :


The programmer defines the addresses and the corresponding bytes. It is time consuming because programmer must first understand the processor instructions and their machine codes Software in assembly language : Programmer must understand the processor and its instructions thoroughly.

Extremely useful for configuring physical devices like ports, display interface, ADC, DAC, device driver codes etc.,
Provides optimal coding solution Time consuming but suitable for simple and small scale system

15

SELVAM

4 April 2013

Software in high level language :

The detailed operation of the target processor is mostly hidden Permits code portability between different devices Reduces software development time C , C++ or JAVA are preferred languages Most of the time C is the preferred language because : C is not designed for any one particular area of application is a general purpose programming language provides code efficiency elements of structured programming - rich set of operators, making C a convenient and effective programming solution
16 SELVAM 4 April 2013

Software for the device drivers and device management using OS :

In ES exemplary physical devices are keyboard, display, disk, parallel port and network card DEVICE : The control registers, input data buffers, output data buffers and status registers form part of the device hardware DEVICE DRIVER : is a software for controlling, receiving, and sending a byte or a stream of bytes from or to a device. It controls three function : 1. Initialization by placing CW into CR 2. Calling an interrupt handler routine 3. Resetting status flag after ISR service

Device driver accesses parallel port, serial port, keyboard, mouse, disk, network, display, file and pipe at specific addresses

17

SELVAM

4 April 2013

OS : may provide device driver codes for system port addresses and for the access mechanism for the device hardware

Using OS functions, device driver coding can be made such that the underlying hardware is hidden as much as possible an API defines the hardware separately

Device Management software modules provides codes for detecting the presence of devices, for initialization and for testing the devices that are present

18

SELVAM

4 April 2013

Software design for scheduling Multiple Tasks and Devices using an

RTOS: Embedded software is most often designed for performing multiple actions and controlling multiple devices and their ISRs. Multitasking software is therefore essential. For scheduling multiple tasks RTOS are most often used In a multitasking OS, each task has a distinct memory allocation of its own and a task has one or more functions or procedures for a specific job. A task may share the data/memory with other task The kernels important function is to schedule the transition of a task from a ready state to running state. It also controls IPCs, messaging and sharing of variables, queues and pipes

19

SELVAM

4 April 2013

Editor

: for writing C / Assembly codes using the keyboard of the PC for entering the program. Allows the entry, addition, deletion, insert etc., : translates ALP into binary file. Also creates list file which has address, source code and hex code

Assembler

Cross Assembler : converting object codes for a processor to other

codes for another processor


Interpreter
Compiler

: line by line translation into machine codes

: Uses the complete sets of the codes, may also include codes, functions and expressions from the library routines and creates object file
SELVAM 4 April 2013

20

Simulator

: To simulate all functions of an ES circuit including memory and peripherals : Software and hardware environment that consists of simulators with editors, compilers, assemblers, RTOS, debuggers, tracer, emulators, logic analyzers, EEPROM programmer for the integrated development of a system : summarizing the complete status of the final target system during the development time

IDE

Prototyper

21

SELVAM

4 April 2013

ARM CORE
22 SELVAM 4 April 2013

ARM Ltd Founded in November 1990


Spun out of Acorn Computers

Designs the ARM range of RISC processor cores Licenses ARM core designs to semiconductor

partners who fabricate and sell to their customers.

ARM does not fabricate silicon itself


Also develop technologies to assist with the

design-in of the ARM architecture

Software tools, boards, debug

hardware, application software, bus architectures, peripherals etc

23

SELVAM

4 April 2013

Introduction
Leading provider of 32-bit embedded RISC

24

microprocessors, 75% of market High performance Low power consumption Low system cost Solutions for Embedded real-time systems for mass storage, automotive, industrial and networking applications Secure applications - smartcards and SIMs SELVAM Open platforms running complex operating 4 April 2013 systems

ARM Architecture Version


Version 1 The first ARM processor, developed at Acorn Computers Limited 1983-1985 26-bit address, no multiply or coprocessor support Version 2 Sold in volume in the Acorn Archimedes and A3000 products 26-bit addressing, including 32-bit result multiply and coprocessor Version 2a Coprocessor 15 as the system control coprocessor to manage SELVAM 4 April 2013 cache

25

Version 3 First ARM processor designed by ARM Limited (1990) ARM6 (macro cell) ARM60 (stand-alone processor) ARM600 (an integrated CPU with on-chip cache, MMU, write buffer) ARM610 (used in Apple Newton) 32-bit addressing, separate CPSR and SPSRs Add the undefined and abort modes to allow coprocessor emulation and virtual memory support in supervisor mode Version 3M Introduce the signed and unsigned multiply and multiply accumulate instructions that generate the full 64-bit result
26 SELVAM 4 April 2013

27

Version 4 Add the signed, unsigned half-word and signed byte load and store instructions Reserve some of SWI space for architecturally defined operation System mode is introduced Version 4T 16-bit Thumb compressed form of the instruction set is introduced Version 5T Introduced recently, a superset of version 4T adding the BLX, CLZ and BRK instructions Version 5TE SELVAM 4 April 2013 Add the signal processing instruction set extension

28

Version 6 Media processing extensions (SIMD) 2x faster MPEG4 encode/decode 2x faster audio DSP Improved cache architecture Physically addressed caches Reduction in cache flush/refill Reduced overhead in context switches Improved exception and interrupt handling Important for improving performance in real-time tasks Unaligned and mixed-endian data support Simpler data sharing, application porting and saves memory SELVAM 4 April 2013

ARM Architecture Version

29

SELVAM

4 April 2013

Naming Rule of ARM


ARM {x} {y} {z} {T} {D} {M} {I} {E} {J} {F} {-S} x: series y: memory management / protection unit z: cache T: Thumb decoder D: JTAG debugger M: fast multiplier I: support hardware debug E: enhance instructions (based on TDMI) J: Jazelle F: vector floating point unit S: synthesiable, suitable for EDA tools
30 SELVAM 4 April 2013

ARM Processor Core


Current low-end ARM core for applications like

digital mobile phones 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: EmbeddedICE hardware
Von Neumann architecture
3-stage pipeline
31 SELVAM 4 April 2013

ARM Core Diagram

32

SELVAM

4 April 2013

The Registers

ARM has 37 registers all of which are 32-bits long.

1 dedicated program counter 1 dedicated current program status register

5 dedicated saved program status registers


30 general purpose registers

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) the program counter, r15 (pc) the current program status register, cpsr
Privileged modes (except System) can also access

a particular spsr (saved program status register)


33 SELVAM 4 April 2013

DIFFERENT STATES
When the processor is executing in ARM state:

All instructions are 32 bits wide All instructions must be word aligned
When the processor is executing in Thumb state:

All instructions are 16 bits wide All instructions must be halfword aligned
When the processor is executing in Jazelle state:

All instructions are 8 bits wide Processor performs a word access to read 4

instructions at once
34 SELVAM 4 April 2013

Thumb
Thumb is a 16-bit instruction set

Optimised for code density from C code (~65% of ARM code

size) Improved performance from narrow memory Subset of the functionality of the ARM instruction set
Core has additional execution state - Thumb

Switch between ARM and Thumb using BX instruction


31

ADDS r2,r2,#1 32-bit ARM Instruction

For most instructions generated by compiler:


Conditional execution is not used Source and destination registers identical Only Low registers used Constants are of limited size Inline barrel shifter not used
4 April 2013

1 5

ADD r2,#1

35

16-bit Thumb Instruction SELVAM

SAMPLE CODE
#include <LPC214X.h>

int wait(unsigned int w)


{ unsigned int a,b; for(a=0;a<w;a++) for(b=0;b<200;b++);

36

SELVAM

4 April 2013

int main() { PINSEL0 = 0; PINSEL1 = 0; PINSEL2 = 0; IODIR0 = 0XFFFFFFFF; IODIR1 = 0XFFFFFFFF; IOCLR1 = 0XFFFFFFFF; IOCLR0 = 0XFFFFFFFF; while(1) { IOSET0 = 0XFFFFFFFF;IOSET1 = 0XFFFFFFFF; wait(50000); IOCLR0 = 0XFFFFFFFF;IOCLR1 = 0XFFFFFFFF; wait(50000); } }

37

SELVAM

4 April 2013

Thank You

A hundred times every day I remained myself that my inner and outer lives are based on the labors of other men, living and dead, and that I must exert myself in order to give in the same measure a I have received and am still receiving ALBERT EINSTEIN

38

SELVAM

4 April 2013

You might also like