Sie sind auf Seite 1von 16

Overview of ARM7 LPC 2148

ARM7 Overview
On April 26th, 1985, ARM was first developed by Acorn Computers in
Cambridge, England.

ARM or Advanced RISC Machine, uses a 32-bit RISC (Reduced


Instruction Set Computer) processor.

The CPU at the heart of the LPC2000 family is an ARM7. The ARM7 is a RISC computer with a small instruction set and
consequently a small gate count.

It has high performance, low power consumption and it takes a small


amount of the available silicon die area.

In ARM7 a three-stage pipeline is used.

Architecture of ARM7

ARM7 Registers

The ARM7 is a load-and-store architecture. The central set of registers are a bank of 16 user registers R0 R15.

Each of these registers is 32 bits wide and R0 R12 are user registers in that they do not have any specific other function.

ARM vs THUMB Instruction Set

The ARM7 CPU has two instruction sets: ARM instruction set which has 32-bit wide instructions. THUMB instruction set which has 16-bit wide instructions. The THUMB instruction set is a compressed form of the ARM instruction set. By compiling code in the THUMB instruction set we can get a space saving of 30%, while the same code compiled as ARM code will run 40% faster.

ARM Instruction ADD R0, R0,R1

THUMB Instruction ADD R0,R1

R0 = R0+R1

Big-endian and Little-endian


The ARM7 is designed to operate as a big-endian or little-endian processor. The LPC2000 family fixes the endianess of the processor as little endian (i.e. MSB at highest bit address).

LPC2148 Technical Features


Philips LPC2148 microcontroller operates on 60 MHz clock. It has 512 KB program Flash memory and 40 KB SRAM. LPC2148 uses ARM7TDMI as its core. The T stands for Thumb instruction set. The D stand for ARM7 offers on-chip debug support. The M means that the CPU contains a hardware multiply
unit.

The I means the debug hardware allows breakpoints


and watchpoints to be set.

Read Toggle Switches using ARM

CS0_LED

Clk

P1.16 to P1.23

74HC273
( 8 Positive Edge Triggered FF )

8 LEDs

LPC2148

CS0_LED CS1_SW

P0.19 P0.20

3:8 decoder

P0.22

( 8 Bit buffer ) 74HC274


Enable

8 I/P Switches

CS1_SW

#include "LPC214X.H" void InitializeIO(void);

int main (void) { unsigned char b; InitializeIO( ); while(1) { IOCLR0 = 0x00580000; IOSET0 = 0x00080000; IODIR1 &= 0xFF00FFFF; b = IOPIN1 >> 16; IODIR1 |= 0x00FF0000; IOPIN1 = b << 16; IOCLR0 = 0x00580000; } }

//Initialize the I/O lines

// Address Lines A0,A1,A2 set as 0 // Set A0 to generate chip enable for toggle switches // Set the data lines to input // Read from toggle switches // Set the data lines to output // Display the data on LEDs // A0 - A2 set as 0

void InitializeIO(void) { IODIR0 = 0x00580000; IODIR1 = 0x00ff0000; }

32 x 32 Multiplication in ALP using ARM

.global main: bl ldr bl

main

InitilizeLCD r1,=Message Message_Display1 /* Display message */

ldr ldr mul mov bl

r1,=0x00000006 r2,=0x0000000A r0,r1,r2 r1,#0x10 DisplayDoubleWord

/* Display Result */

here: b here

Message:
.ascii " Multiplication "

.include "LCD.s"

Common files that are used while Programming

LCD.S It contains all the necessary subroutines while using the LCD display like to initialize LCD, display character, display word etc.

LPC214X.H
It is a common header file for 2141/42/46 microcontrollers provided by manufacturer Philips. It contains the address for all the internal blocks and special registers such as Timers, Serial ports etc. eg. # define IODIR0 0XE0028008

Common files that are used while Programming ( contd )

Vector.S

It contains the start up code. This file is used to initialize the values of PC,SP,Timers etc.

Flash.ld It is a Linker file for running the code from flash memory. File named Flash.ld which is Script File uses to keep the beginning and the end of default value with Flash Memory size.

Thank you

Das könnte Ihnen auch gefallen