You are on page 1of 3

Lcd interfacing with lpc2148

#include<lpc214x.h>
unsigned char value1,value2;

Header file and


variable
declaration

void delay(unsigned int t)


{
unsigned int i,j;
for(i=0;i<=t;i++)
for(j=0;j<=1275;j++);
}

Initialization
function

Delay function
void lcd_cmd()
{
IODIR0=0xFFFFFFFF;
IOPIN0=value1;
IOCLR0=0x00000001;
IOCLR0=0x00000002;
IOSET0=0x00000004;
delay(2);
IOCLR0=0x00000004;
}

void lcd_data()
{
IODIR0=0xFFFFFFFF;
IOPIN0=value2;
IOSET0=0x00000001;
IOCLR0=0x00000002;
IOSET0=0x00000004;
delay(2);
IOCLR0=0x00000004;
}

//rs=0
//rw=0
//en=1

lcd_init()
{
unsigned int
init[]={0x00380000,0x000E0000,0
x00060000, 0x00010000 ,0x00800000};
int m;
PINSEL0=0X00000000;
IODIR0=0Xffffffff;
for(m=0;m<=4;m++)
{
value1=init[m];
lcd_cmd();
}
}

Command
function

//en=0

//rs=1
//rw=0
//en=1
//en=0

Data
function

Main
function

int main(void)
{
unsigned int k;
unsigned char d[]={M',S',R',I',T'};
while(1)
{
lcd_init();
for(k=0;k<=4;k++)
{
value2=d[k];
lcd_data();
}
}
}

Sensors
contacted with Switzerland based company (IST AG Innovative Sensor
Technology )

Sensor
name

Range

accuracy

Soil moisture 0
0.2C
Sensor
to100%
rH
Stem
diameter
Sensor

0 to 5
mm

resolution

temperatu
re

0.03% rH

-40 to
125C

5 to 25
<0.002
(stem dia) mm

Fruit growth 30 to
<2%
sensor
160 mm

0.005 mm

0 to 50 c

0 to 50 c

Work plan
January:-interfacing temperature sensor with
ARM7 and display it on Lcd.
ARM 7
16X2 LCD

LM 35
temperature
sensor

You might also like