Académique Documents
Professionnel Documents
Culture Documents
On
To Scroll your name on LCD interfaced with ARM-7 Embedded Development System
Branch : ENC
Batch : 2015-2019
Group : ENC-2
(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
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.
RISC Organization:
o Pipelined execution
RISC Advantages
RISC Disadvantages
3
o Cannot execute x86 code, at least not without some sort of conversion and
performance drawback
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