LCDInfo.com http://forum.lcdinfo.com/ |
|
can not read data from ks0108 http://forum.lcdinfo.com/viewtopic.php?f=9&t=2391 |
Page 1 of 1 |
Author: | abbas1707 [ Tue Jan 15, 2008 1:51 ] |
Post subject: | can not read data from ks0108 |
hi, this is my 1st post in this forum . i was playing with ks0108 lcd on proteus. i am able to write data,fonts and images to lcd . but i cant read data from display RAM. here is code for reading data from lcd Code: #include <reg51.h>
sbit rs=P3^3; sbit rw=P3^2; sbit en=P3^1; sbit cs1=P3^5; sbit cs2=P3^4; void delay() { int k,l; for(k=0;k<3;k++) for(l=0;l<50;l++); } void sendCommand(unsigned char val) { P1=val; rs=0; rw=0; en=1; en=0; } void sendByte(unsigned char dat) { P1=dat; rs=1; rw=0; en=1; en=0; } void readByte() { P1=0xff; rs=1; rw=1; delay(); en=1; delay(); en=0; P2=P1; } void main() { while(1) { cs1=0; sendCommand(0x40); sendCommand(0xb8); sendByte(0xf4); sendCommand(0x40); sendCommand(0xb8); readByte(); readByte(); } } please help me solving this problem |
Author: | abbas1707 [ Tue Jan 15, 2008 15:54 ] |
Post subject: | :( |
is this forum closed |
Page 1 of 1 | All times are UTC + 2 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |