nitinpatil
Member level 1
- Joined
- Oct 29, 2012
- Messages
- 41
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Pune, Maharashtra, India
- Activity points
- 1,557
Facing problem in Interfacing of LPC2138 to LCD(16x2 alpha.)
Using port as
RS = 0.28
EN = 0.29
WR = GND
D0-D7 = 1.16 - 1.23
I want to use this same ports for this because of my hardware
I attach proteus connection dig. but its not working
also I attach my programme code which is simple one for testing but its not working
I stuck where is the problem
Please help me...
Thanks in advance..
Nitin
Using port as
RS = 0.28
EN = 0.29
WR = GND
D0-D7 = 1.16 - 1.23
I want to use this same ports for this because of my hardware
I attach proteus connection dig. but its not working
also I attach my programme code which is simple one for testing but its not working
I stuck where is the problem
Code:
#include<LPC213X.h>
void delay()
{
int i;
for(i=0;i<900000;i++);
}
void DAT(unsigned char data)
{
IOCLR1 = 0X00FF0000; // port 1.16 to 1.23
IOSET0 = 0X10000000;
IOSET0 = 0X20000000; // port 0.28 to 0.29
IOSET1 = data<<16;
delay();
IOCLR0 = 0x20000000;
}
void CMD(unsigned int cmd)
{
IOCLR1 = 0X00FF0000;
IOCLR0 = 0X10000000;
IOSET0 = 0x20000000;
IOSET1 = cmd<<16;
delay();
IOCLR0 = 0x20000000;
}
int main(void)
{
IODIR1 = 0X00FF0000;
IODIR0 = 0X30000000;
CMD(0X38);
delay();
CMD(0X0C);
delay();
CMD(0X01);
delay();
CMD(0X0E);
delay();
CMD(0X06);
delay();
CMD(0X80);
delay();
DAT('A');
delay();
DAT('B');
delay();
return 0;
}
Thanks in advance..
Nitin
Last edited: