<?xml version="1.0" encoding="utf-8"?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rss  version="2.0">
				<channel>
				<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>

<language>en-gb</language>
				<copyright><a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/in/" target="_blank"><img alt="Creative Commons License" width="80" height="15" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/in/80x15.png" target="_blank" /></a>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/in/" target="_blank">Creative Commons Attribution-Noncommercial 2.5 India License</a>.<a href='http://www.8051projects.net/disclaimer.htm' target='_blank' />Rickey's World Disclaimer</a></copyright>
				<managingEditor>Ajay Bhargav - contact@nospam.com</managingEditor>
				<webMaster>contact@nospam.com</webMaster>
				<pubDate>Mon, 01 Dec 2008 12:25:46 -0800</pubDate>
				<lastBuildDate>Mon, 01 Dec 2008 12:25:46 -0800</lastBuildDate>
				<docs>http://backend.userland.com/rss</docs>
				<generator>e107 (http://e107.org)</generator>
				<ttl>60</ttl>
				<textInput>
				<title>Search</title>
				<description>Search 8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes</description>
				<name>query</name>
				<link>http://www.8051projects.net/search.php</link>
				</textInput>
						<item>
						<title>2 Line LCD 8051 (Strange problem)</title>
<link>http://www.8051projects.net/forum-t10568.html</link>
<description><![CDATA[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).<br /><br />The output is sometimes printed well on the LCD but sometimes it just print the first line and does not print the second line.<br /><br />Can anyone help me rectifying it?<br /><br /> <div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;"><br /><span style="color: #808080; font-style: italic;">/********************************************************* &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 />*********************************************************/</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /><span style="color: #339933;">#include&lt;P89V51RX2.h&gt;</span><br /><span style="color: #339933;">#include&lt;intrins.h&gt;</span><br /><span style="color: #339933;">#include&lt;string.h&gt;</span><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************<br />Function Prototypes<br />*********************************************************/</span><br /><span style="color: #993333;">void</span> delay<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">void</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #993333;">void</span> writecommand<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #993333;">void</span> writedata<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #993333;">void</span> printlcd<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> *<span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #993333;">void</span> nextline<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">void</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #808080; font-style: italic;">/*********************************************************/</span><br /><br /><br />xdata <span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> rs _at_ 0xFE01;<br /><span style="color: #808080; font-style: italic;">//xdata volatile unsigned char en _at_ 0xFE00;</span><br />xdata <span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> lcd _at_ 0xFE00;<br /><br /><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************<br />Function which causes some &nbsp;delay<br />*********************************************************/</span><br /><span style="color: #993333;">void</span> delay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><span style="color: #993333;">int</span> k;<br /><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>k=<span style="color: #cc66cc;">0</span>;k&lt;=<span style="color: #cc66cc;">9000</span>;k++<span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #808080; font-style: italic;">/*********************************************************/</span><br /><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************<br />Function to initialize lcd<br />*********************************************************/</span><br /><span style="color: #993333;">void</span> init_lcd<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />writecommand<span style="color: #66cc66;">&#40;</span>0x38<span style="color: #66cc66;">&#41;</span>;<br />writecommand<span style="color: #66cc66;">&#40;</span>0x06<span style="color: #66cc66;">&#41;</span>;<br />writecommand<span style="color: #66cc66;">&#40;</span>0x0e<span style="color: #66cc66;">&#41;</span>;<br /><br />writecommand<span style="color: #66cc66;">&#40;</span>0x01<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//Clear the display</span><br /><br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************/</span><br /><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************<br />Function to write data into lcd<br />*********************************************************/</span><br /><span style="color: #993333;">void</span> writecommand<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> data1<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />lcd=data1;<br /><span style="color: #808080; font-style: italic;">//en=1;</span><br /><span style="color: #808080; font-style: italic;">//en=1;</span><br />_nop_<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />_nop_<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #808080; font-style: italic;">//en=0;</span><br />delay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #808080; font-style: italic;">/*********************************************************/</span><br /><br /><span style="color: #993333;">void</span> writedata<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> data2<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />rs=data2;<br /><span style="color: #808080; font-style: italic;">//en=1;</span><br /><span style="color: #808080; font-style: italic;">//en=1;</span><br />_nop_<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />_nop_<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #808080; font-style: italic;">//en=0;</span><br /><span style="color: #808080; font-style: italic;">//delay();</span><br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************<br />Function to print a string data into lcd<br />*********************************************************/</span><br /><br />&nbsp;<span style="color: #993333;">void</span> printlcd<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> *str<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> len,i;<br /><br /><span style="color: #808080; font-style: italic;">//rs=1;</span><br /><br />len=strlen<span style="color: #66cc66;">&#40;</span>str<span style="color: #66cc66;">&#41;</span>;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>i=<span style="color: #cc66cc;">1</span>;i&lt;=len;i++<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; writedata<span style="color: #66cc66;">&#40;</span>*str<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; str++;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************/</span><br /><br /><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************<br />Function to send a command to print in 2nd line<br />*********************************************************/</span><br /><br /><span style="color: #993333;">void</span> nextline<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><span style="color: #808080; font-style: italic;">//rs=0;</span><br />writecommand<span style="color: #66cc66;">&#40;</span>0xc0<span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #808080; font-style: italic;">/*********************************************************/</span><br /><br /><br /><span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><br />AUXR=0x03;<br /><span style="color: #808080; font-style: italic;">//rw=0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//read/write pin made 0 </span><br /><br />init_lcd<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">//initialize lcd</span><br /><br />printlcd<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Hello how r u?&quot;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">//send a string for display</span><br /><br />nextline<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// Next Line</span><br /><br />printlcd<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;I am fine&quot;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">//send a string for display</span><br /><br /><span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;<br /><br /><span style="color: #66cc66;">&#125;</span><br />&nbsp;</div></div>]]></description>
<pubDate>Thu, 03 Jul 2008 10:30:53 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10568.html</guid>
</item>
						<item>
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
<link>http://www.8051projects.net/forum-t10568.html</link>
<description><![CDATA[If I give more delay then it does not look nice when the display shifts left or right.<br /><br />Can anyone tell me how to achieve the following feature in 2 line LCD:  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/102.gif' alt='' style='vertical-align:middle; border:0' />  <br /><br />- Line 1 display shift left.<br />- Line 2 display shift right.<br /><br />or <br /><br />- Line 1 display no shift.<br />- Line 2 display shift right.<br /><br />]]></description>
<author>say2paul&lt;say2paul@nospam.com&gt;</author>
<pubDate>Thu, 03 Jul 2008 22:18:44 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10568.html</guid>
</item>
						<item>
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
<link>http://www.8051projects.net/forum-t10568.html</link>
<description><![CDATA[Hello<br /><br />increase the delay to about 15 to 20 mili seconds.<br />Give delay in Write data command routine too.]]></description>
<author>Amin Sharif&lt;projectam2004@nospam.com&gt;</author>
<pubDate>Thu, 03 Jul 2008 20:35:38 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10568.html</guid>
</item>
						<item>
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
<link>http://www.8051projects.net/forum-t10568.html</link>
<description><![CDATA[use an array and rotate it..<br /><br />shift that array left or right one byte or say one element, display on LCD, then give some delay before shifting the next element.<br /><br />you can do this shift as you want. IT Pro wont have any problem doing it <img src='http://www.8051projects.net/e107_images/emotes/yahoo/3.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Thu, 03 Jul 2008 23:28:46 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10568.html</guid>
</item>
						<item>
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
<link>http://www.8051projects.net/forum-t10568.html</link>
<description><![CDATA[Smart!! but I was talking about the display shift commands.<br /><br />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.<br /><br />So, its display shift commands <img src='http://www.8051projects.net/e107_images/emotes/yahoo/3.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>say2paul&lt;say2paul@nospam.com&gt;</author>
<pubDate>Fri, 04 Jul 2008 02:07:57 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10568.html</guid>
</item>
						<item>
						<title>Re: 2 Line LCD 8051 (Strange problem)</title>
<link>http://www.8051projects.net/forum-t10568.html</link>
<description><![CDATA[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.<br /><br />only possible with software...]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Mon, 07 Jul 2008 07:52:47 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10568.html</guid>
</item>
				</channel>
				</rss>