Vous êtes sur la page 1sur 10

A

Minor Project Report

On

To Scroll your name on LCD interfaced with ARM-7 Embedded Development System

Subject Name : Microprocessors and Their Applications

Subject Code : UEC405

Branch : ENC

Batch : 2015-2019

Group : ENC-2

Submitted by : NISHANT SAINI(101515034)

PARAG BHATIA (101515036)

JAINENEDRA KUMAR JAIN (101515064)

Electronics and Communication Engineering Department, Thapar University

(Established under the section 3 of UGC Act, 1956) Patiala 147004 (Punjab)

TABLE OF CONTENTS
CONTENTS PAGE NO.

AIM 1
APPARATUS
INTRODUCTION

INTRODUCTION 2
o ARM7 (LPC2148)

INTRODUCTION 3
o ARCHITECTURAL
OVERVIEW

INTRODUCTION 4
o LCD
o PIN DESCRIPTION OF LCD

INTERFACING ARM WITH LCD 5


CIRCUIT DIAGRAM

CODE 6

CONCLUSIONS 7

SNAPSHOTS 8

2
AIM: To scroll your name on LCD interfaced with ARM-7 Embedded Development System.

APPARATUS: LPC214x development board, 16x2 LCD module, jumpers, adapter and USB
cable.

INTRODUCTION :

ARM - an acronym for: Advanced RISC Machines. The processor originated in England in 1984.
At its inception, ARM stood for Acorn RISC Machine. The first ARM reliant systems include the
Acorn: BBC Micro, Masters, and the Archimedes. During this early period, they were used
mostly for British educational systems, and therefore, were not widely available or known
outside England. However, in 1987 the ARM became the first commercial RISC processor.

What is a RISC machine anyways? A brief overview


It is worthwhile to go over this concept since RISC is implied in the name! It also lends itself to
the discussion of where some of the hardware choices, as well as claims that are made on this
type of processor's performance, came from.
RISC is an acronym standing for "Reduced Instruction Set Computer", contrasted with a
CISC machine (Complex Instruction Set Computer).
RISC claims of simplicity in comparison to CISC:

o Fixed 32-bit instruction size instead of variable

o Large register bank of GPR 32-bit registers

o Easier to prototype and put together

RISC Organization:

o Hard-wired instruction decode logic instead of micro coded ROMs to decode

o Pipelined execution

RISC Advantages

o Smaller die sizes

o Shorter time to develop

o Possible higher performance than CISC

o High clock rate with single cycle

RISC Disadvantages

o Generally, less code density than CISC

3
o Cannot execute x86 code, at least not without some sort of conversion and
performance drawback

ARM7 (LPC2148): ARM (Advanced RISC Machine) is a 32-bit RISC processor


architecture with 8kB to 40kB of on-chip static RAM and 32kB to 512kB of on-chip flash
memory. Its 128-bit wide interface/accelerator enables 60MHz operation. Pipelining technique
are employed so that all parts of processing and memory systems can operate continuously.
Typically, while one instruction is being executed, its successor is being decoded, and a third
instruction is being fetched from memory.
LPC 2148 is a 32 bit ARM7TDMI microcontroller in 64 pin package developed by Philips. It
operates at 3.3 volts. It has two ports:
1. P0.0 to P0.31: Port o is a 32 bit I/O port with individual direction controls for each bit.
Total of 31 pins of port o can be used as a general purpose bidirectional digital I/O pins
while P0.31 is output only pin.
2. P1.0 to P1.31: Port 1 is a 32 bit I/O port with individual direction controls for each bit.
Pins 2,3,5,6,7,11,12, and 13 of this port are not available.
The function of a pin can select using a register PINSEL. Two bits in the PINSEL register is used
to select the function of a one port pin. Using PINSEL0 we can only select the function of port0
pin up to 15.
The IODIR register is used to configure the direction of the pin. If we write one, corresponding
pin become output. IOSET is used to out a value through corresponding port. We can only out
high from this register. IOCLR register is used to make port pins LOW by writing HIGH.

ARCHITECTURAL OVERVIEW:

4
The LPC2148 consists of an ARM7TDMI-S CPU with emulation support, the ARM7 Local Bus
for interface to on-chip memory controllers, the AMBA Advanced High-performance Bus (AHB)
for interface to the interrupt control, and the VLSI Peripheral Bus for connection to on-chip
peripheral functions. The LPC2148 configures the ARM7TDMI-S processor in little-endian byte
order.
AHB peripherals are allocated a 2MB range of addresses at the very top of the 4GB ARM
memory space. Each AHB peripheral is allocated a 16KB address space within the AHB address
space. LPC2148 peripheral functions are connected to the VPB bus. The AHB to VPB bridge
interfaces the VPB bus to the AHB bus. VPB peripherals are also allocated a 2MB range of
addresses, beginning at the 3.5GB address point. Each VPB peripheral is a 16KB address space
within the VPB address space.
The connection of on chip peripherals to device pins is controlled by a Pin Connection Block.
This must be configured by software to fit specific application requirements for the use
peripherals functions and pins.

LCD: A liquid crystal display is a thin, flat panel used for electronically displaying information
such as text, images and moving pictures. It is an electronically-modulated optical device made

5
up of any number of pixels filled with liquid crystals and arranged in front of a light
source(Backlight). It operates at 5V.
16*2 LCD: MODEL: JHD162A. It consists of 2 rows with 16 characters each. It has a 16 pin
interface, operates on 5V and has LED backlight. Works in 2 modes:
1. Instruction Mode: Used for initialization and configuring LCD before we can use it and
during operation.
2. Data Mode: Displays the respective characters for codes supplied to via data pins.

There are 8 data pins: BB0-DB7. The data and command are given through pins. Other pins are:
EN-enable: The LCD controller takes the data only after getting high to low transition in this pin.

Pin Description:

Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
Selects command register when low; and data register Register
4
when high Select
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-

16*2 LCD: MODEL: JHD162A. It consists of 2 rows with 16 characters each. It has a 16 pin
interface, operates on 5V and has LED backlight. Works in 2 modes:

6
Instruction Mode: Used for initialization and configuring LCD before we can use it and during
operation.
Data Mode: Displays the respective characters for codes supplied to via data pins.
There are 8 data pins: BB0-DB7. The data and command are given through pins. Other pins are:
EN-enable: The LCD controller takes the data only after getting high to low transition in this
pin.
R/W: Mode of operation is selected using this pin, giving LOW for write on LCD and HIGH for
reading from LCD.
RS: Register select pin. LCD has two registers namely data register and command register. The
LCD controller will take values in data pins as commands when RS pin is in LOW state. If RS is
in high state, the controller will take the values in data pins for displaying

INTERFACING LCD:
The 1st thing required for this is that RS must be LOW and EN also be LOW in the beginning.
Now commands are supplied using data pins to LCD. But these commands are not executed until
a pulse is supplied to EN pin. After this make EN HIGH and the LOW after a short delay and the
command is executed. In our case we use 8-bit Mode with 2 rows and 5x10 font style which
gives function set as 0x3C. Next we issue display ON, Cursor ON, blink ON which gives display
switch as 0x0F, next select increment mode and then clear the screen and set cursor at home.
CIRCUIT DIAGRAM:
Connections: P1.16 to P1.23 of LPC2148 are connected to data pins- D0 to D7 respectively. Vss
and R/w pins are connected to ground because data is only written to LCD and is not read from
LCD. RS and E pins of LCD are connected to P1.16 and P1.17 of LPC2148 respectively

7
CODE:
PINOUT LCD LPC2148
DB0- P1.16
DB1- P1.17
DB2- P1.18
DB3- P1.19
DB4- P1.20
DB5- P1.21
DB6- P1.22
DB7- P1.23
RS- P1.24
E- P1.25
R/W-GND
**********************INCLUDES******************************
#include <lpc214x.h>
////////////////////////////////////////////USER SETTINGS////////////////////////////////////////
#defIne DATA_PORT_SET IOSET1
#defIne DATA_PORT_CLR IOCLR1
#defIne DATA_DIR IODIR1
#define D7 23
#define D6 22
#define D5 21
#define D4 20
#define D3 19
#define D2 18
#define D1 17
#define D0 16
#define DATA_PORT(unsigned long)((1<<d7)| (1<<d6)| (1<<d5)| (1<<d4)| (1<<d3)| (1<<d2)|
(1<<d1)| (1<<d0))
#defIne DATA_PORT_SET IOSET1
#defIne DATA_PORT_CLR IOCLR1
#defIne DATA_DIR IODIR1
#defIne DATA_RS 24

8
#defIne DATA_EN 25
////////////////////////////////////END OF USER SETTING///////////////////////////////////////
#include delay.h
#includelcd.h
//*************************END OF INCLUDES*******************
Int main()
{
Int i;
Init_lcd();
While(1)
{
Cmd_lcd(0x80);
String_lcd(MICROPROCESSORS AND APPLICATIONS);
Cmd_lcd(0xc0);
String_lcd(ECE3);
For(i=0;i<5;i++)
{
Cmd_lcd(0x1c);
delay_ms(1000);
}
For(i=0;i<5;i++)
{
Cmd_lcd(0x18);
Delay_ms(1000);
}

Conclusions:
The hardware and software features of interfacing LCD module with an ARM Processor was
successfully done and string was displayed on LCD.
We also conclude that ARM based microprocessor can also be programmed with C language as
well as assembly language.

9
SNAPSHOTS:

10

Vous aimerez peut-être aussi