<?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>2008 Rickey's World</copyright>
				<managingEditor>contact@nospam.com (Ajay Bhargav)</managingEditor>
				<webMaster>contact@nospam.com (Ajay Bhargav)</webMaster>
				<pubDate>Thu, 08 Jan 2009 21:54:11 -0800</pubDate>
				<lastBuildDate>Thu, 08 Jan 2009 21:54:11 -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>UART 8051 - Read data</title>
<link>http://www.8051projects.net/forum-t10612.html</link>
<description><![CDATA[I know my post might look weird as I am noob, but believe me I only got time to learn uC's at night as I am really very busy in daytime with Symbian C++.<br /><br />Please look at the following code and let me know the mistake, here I am trying to print back a character  to the hyper terminal in window OS. I wrote the code in such a way so that it can detect the character entered by user in hyper terminal and then send the same back to the hyper terminal.<br /><br />I know I must be doing something wrong that is why I am unable to type anything on the Hyper Terminal <img src='http://www.8051projects.net/e107_images/emotes/yahoo/2.gif' alt='' style='vertical-align:middle; border:0' /> <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;"><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: #993333;">void</span> delay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #993333;">int</span> i;<br />&nbsp;<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>i=<span style="color: #cc66cc;">0</span>;i&lt;<span style="color: #cc66cc;">9000</span>;i++<span style="color: #66cc66;">&#41;</span>;<br />&nbsp;<span style="color: #66cc66;">&#125;</span><br />&nbsp;<br /><span style="color: #993333;">void</span> serial_send<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> dat<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>!TI<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; TI = <span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; SBUF = dat;<br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> serial_read<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>!RI<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; RI = <span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> SBUF;<br /><span style="color: #66cc66;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;<span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span><br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> i,data1; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; TMOD=0x20;<br />&nbsp; &nbsp; SCON=0x50;<br />&nbsp; &nbsp; TH1=0xfd;<br />&nbsp; &nbsp; TL1=0xfd;<br />&nbsp; &nbsp; TR1=<span style="color: #cc66cc;">1</span>;<br />&nbsp; <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 />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333;">char</span> a = serial_read<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; serial_send<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp;<br /><span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;</div></div><br /><br /><br /><br />]]></description>
<pubDate>Fri, 04 Jul 2008 11:39:52 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10612.html</guid>
</item>
						<item>
						<title>Re: UART 8051 - Read data</title>
<link>http://www.8051projects.net/forum-t10612.html</link>
<description><![CDATA[I am not sure how you're able to compile it <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />coz you are using C now.. not c++ so<br /><br />this thing is not possible within the program..<br /><div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;"><span style="color: #993333;">char</span> a = serial_read<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></div><br /><br />As per ANSI C you have to define the character at the top of program.]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 07 Jul 2008 08:01:35 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10612.html</guid>
</item>
						<item>
						<title>Re: UART 8051 - Read data</title>
<link>http://www.8051projects.net/forum-t10612.html</link>
<description><![CDATA[I am moving your post in 8051 discussion section <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 07 Jul 2008 08:02:18 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10612.html</guid>
</item>
						<item>
						<title>Re: UART 8051 - Read data</title>
<link>http://www.8051projects.net/forum-t10612.html</link>
<description><![CDATA[Sashi what paul wrote is fine just the problem is he declared the variable within the function which is not valid in C <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />he is used to of c++ a lot i guess <img src='http://www.8051projects.net/e107_images/emotes/yahoo/4.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 08 Jul 2008 08:01:06 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10612.html</guid>
</item>
						<item>
						<title>Re: UART 8051 - Read data</title>
<link>http://www.8051projects.net/forum-t10612.html</link>
<description><![CDATA[<div class='indent'>void serial_send(unsigned char dat){<br />        while(!TI);<br />        TI = 0;<br />        SBUF = dat;<br />}</div><br /><br />Change to ...<br /><br />void serial_send(unsigned char dat){<br />        SBUF = dat;<br />        while(!TI);<br />        TI = 0;<br />       <br />}]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 07 Jul 2008 19:47:57 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10612.html</guid>
</item>
						<item>
						<title>Re: UART 8051 - Read data</title>
<link>http://www.8051projects.net/forum-t10612.html</link>
<description><![CDATA[Its fact... and its difficult to follow C Standards...<br /><br />But I will get use to it <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 08 Jul 2008 08:38:10 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10612.html</guid>
</item>
				</channel>
				</rss>