<?xml version="1.0" encoding="utf-8" ?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
				<channel rdf:about="http://www.8051projects.net/">
				<title>8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes : Forum / topic</title>
				<link>http://www.8051projects.net/</link>
				<description>Learn to make simple microcontroller projects, pic, 8051, avr and arm projects. download 8051 projects, tutorials, libraries, sample codes. join the microcontroller discussion forum and ask doubts regarding electronics. the best source for 8051 over internet.</description>
				<dc:language>en-gb</dc:language>
				<dc:date>2008-12-01T23:15:44-08:00</dc:date>
				<dc:creator>contact@nospam.com</dc:creator>
				<admin:generatorAgent rdf:resource="http://e107.org" />
				<admin:errorReportsTo rdf:resource="mailto:contact@nospam.com" />
				<sy:updatePeriod>hourly</sy:updatePeriod>
				<sy:updateFrequency>1</sy:updateFrequency>
				<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
				<items>
				<rdf:Seq>
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10568.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10568.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10568.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10568.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10568.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10568.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t10568.html">
						<title>2 Line LCD 8051 (Strange problem)</title>
						<link>http://www.8051projects.net/forum-t10568.html</link>
						<dc:date>2008-12-01T23:15:44-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>Please look at the following code and let me know where I am wrong? In the following code I am not using the BF flag instead I am providing a delay using for loop (12 MHz).The output is sometimes printed well on the LCD but sometimes it just print the first line and does not print the second line.Can anyone help me rectifying it? CODE:<br />/********************************************************* &nbsp;<br />* &nbsp; &nbsp;PROGRAM TO TEST LCD INTERFACE &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br /><br />* &nbsp; &nbsp;ADDRESS OF LED'S = 0XFD00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />*********************************************************/<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />#include&lt;P89V51RX2.h><br />#include&lt;intrins.h><br />#include&lt;string.h><br /><br />/*********************************************************<br />Function Prototypes<br />*********************************************************/<br />void delay&#40;void&#41;;<br />void writecommand&#40;unsigned char&#41;;<br />void writedata&#40;unsigned char&#41;;<br />void printlcd&#40;unsigned char *&#41;;<br />void nextline&#40;void&#41;;<br />/*********************************************************/<br /><br /><br />xdata volatile unsigned char rs _at_ 0xFE01;<br />//xdata volatile unsigned char en _at_ 0xFE00;<br />xdata volatile unsigned char lcd _at_ 0xFE00;<br /><br /><br /><br />/*********************************************************<br />Function which causes some &nbsp;delay<br />*********************************************************/<br />void delay&#40;&#41;<br />&#123;<br />int k;<br />for&#40;k=0;k&lt;=9000;k++&#41;;<br />&#125;<br />/*********************************************************/<br /><br /><br />/*********************************************************<br />Function to initialize lcd<br />*********************************************************/<br />void init_lcd&#40;&#41;<br />&#123;<br />writecommand&#40;0x38&#41;;<br />writecommand&#40;0x06&#41;;<br />writecommand&#40;0x0e&#41;;<br /><br />writecommand&#40;0x01&#41;; //Clear the display<br /><br />&#125;<br /><br />/*********************************************************/<br /><br /><br />/*********************************************************<br />Function to write data into lcd<br />*********************************************************/<br />void writecommand&#40;unsigned char data1&#41;<br />&#123;<br />lcd=data1;<br />//en=1;<br />//en=1;<br />_nop_&#40;&#41;;<br />_nop_&#40;&#41;;<br />//en=0;<br />delay&#40;&#41;;<br />&#125;<br />/*********************************************************/<br /><br />void writedata&#40;unsigned char data2&#41;<br />&#123;<br />rs=data2;<br />//en=1;<br />//en=1;<br />_nop_&#40;&#41;;<br />_nop_&#40;&#41;;<br />//en=0;<br />//delay();<br />&#125;<br /><br />/*********************************************************<br />Function to print a string data into lcd<br />*********************************************************/<br /><br />&nbsp;void printlcd&#40;unsigned char *str&#41;<br />&#123;<br />unsigned char len,i;<br /><br />//rs=1;<br /><br />len=strlen&#40;str&#41;;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; for&#40;i=1;i&lt;=len;i++&#41;<br />&nbsp; &nbsp; &nbsp; &nbsp; &#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; writedata&#40;*str&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; str++;<br />&nbsp; &nbsp; &nbsp; &nbsp; &#125;<br />&#125;<br /><br />/*********************************************************/<br /><br /><br /><br />/*********************************************************<br />Function to send a command to print in 2nd line<br />*********************************************************/<br /><br />void nextline&#40;&#41;<br />&#123;<br />//rs=0;<br />writecommand&#40;0xc0&#41;;<br />&#125;<br /><br />/*********************************************************/<br /><br /><br />void main&#40;&#41;<br />&#123;<br /><br />AUXR=0x03;<br />//rw=0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//read/write pin made 0 <br /><br />init_lcd&#40;&#41;;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//initialize lcd<br /><br />printlcd&#40;"Hello how r u?"&#41;;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//send a string for display<br /><br />nextline&#40;&#41;; // Next Line<br /><br />printlcd&#40;"I am fine"&#41;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//send a string for display<br /><br />while&#40;1&#41;;<br /><br />&#125;<br />&nbsp;</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10568.html">
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
						<link>http://www.8051projects.net/forum-t10568.html</link>
						<dc:date>2008-12-01T23:15:44-08:00</dc:date>
						<dc:creator>say2paul</dc:creator>
						<dc:subject></dc:subject>
						<description>If I give more delay then it does not look nice when the display shifts left or right.Can anyone tell me how to achieve the following feature in 2 line LCD:    - Line 1 display shift left.- Line 2 display shift right.or - Line 1 display no shift.- Line 2 display shift right.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10568.html">
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
						<link>http://www.8051projects.net/forum-t10568.html</link>
						<dc:date>2008-12-01T23:15:44-08:00</dc:date>
						<dc:creator>Amin Sharif</dc:creator>
						<dc:subject></dc:subject>
						<description>Helloincrease the delay to about 15 to 20 mili seconds.Give delay in Write data command routine too.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10568.html">
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
						<link>http://www.8051projects.net/forum-t10568.html</link>
						<dc:date>2008-12-01T23:15:44-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>use an array and rotate it..shift that array left or right one byte or say one element, display on LCD, then give some delay before shifting the next element.you can do this shift as you want. IT Pro wont have any problem doing it</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10568.html">
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
						<link>http://www.8051projects.net/forum-t10568.html</link>
						<dc:date>2008-12-01T23:15:44-08:00</dc:date>
						<dc:creator>say2paul</dc:creator>
						<dc:subject></dc:subject>
						<description>Smart!! but I was talking about the display shift commands.Suppose I give right shift command to the LCD, both the lines start moving in the right direction, but I want only one line to move and other to stay intact.So, its display shift commands</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10568.html">
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
						<link>http://www.8051projects.net/forum-t10568.html</link>
						<dc:date>2008-12-01T23:15:44-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>well display shift will shift the entire display (behind the scene.. it shift the ram content in cyclic way) so its not possible to shift a single line.only possible with software...</description>
						</item>
				</rdf:RDF>