<?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>2009-01-07T17:58:31-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-t10612.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10612.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10612.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10612.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10612.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10612.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t10612.html">
						<title>UART 8051 - Read data</title>
						<link>http://www.8051projects.net/forum-t10612.html</link>
						<dc:date>2009-01-07T17:58:31-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>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++.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.I know I must be doing something wrong that is why I am unable to type anything on the Hyper Terminal   CODE:#include&lt;P89V51Rx2.h><br />#include&lt;intrins.h><br />#include&lt;string.h><br /><br />void delay&#40;&#41;<br /><br />&nbsp; &nbsp;&#123;<br />&nbsp; &nbsp; int i;<br />&nbsp;for&#40;i=0;i&lt;9000;i++&#41;;<br />&nbsp;&#125;<br />&nbsp;<br />void serial_send&#40;unsigned char dat&#41;&#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; while&#40;!TI&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; TI = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; SBUF = dat;<br />&#125;<br />unsigned char serial_read&#40;&#41;&#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; while&#40;!RI&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; RI = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; return SBUF;<br />&#125; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;void main&#40;&#41;<br />&nbsp; &nbsp;&#123;<br />unsigned char 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=1;<br />&nbsp; while&#40;1&#41;<br />&nbsp; &nbsp; &nbsp; &nbsp; &#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char a = serial_read&#40;&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delay&#40;&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; serial_send&#40;a&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &#125;&nbsp; &nbsp; &nbsp; &nbsp;<br />&#125;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10612.html">
						<title>Re: UART 8051 - Read data</title>
						<link>http://www.8051projects.net/forum-t10612.html</link>
						<dc:date>2009-01-07T17:58:31-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>I am not sure how you're able to compile it  coz you are using C now.. not c++ sothis thing is not possible within the program..CODE:char a = serial_read&#40;&#41;;As per ANSI C you have to define the character at the top of program.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10612.html">
						<title>Re: UART 8051 - Read data</title>
						<link>http://www.8051projects.net/forum-t10612.html</link>
						<dc:date>2009-01-07T17:58:31-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>I am moving your post in 8051 discussion section</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10612.html">
						<title>Re: UART 8051 - Read data</title>
						<link>http://www.8051projects.net/forum-t10612.html</link>
						<dc:date>2009-01-07T17:58:31-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>Sashi what paul wrote is fine just the problem is he declared the variable within the function which is not valid in C  he is used to of c++ a lot i guess</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10612.html">
						<title>Re: UART 8051 - Read data</title>
						<link>http://www.8051projects.net/forum-t10612.html</link>
						<dc:date>2009-01-07T17:58:31-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>void serial_send(unsigned char dat){        while(!TI);        TI = 0;        SBUF = dat;}Change to ...void serial_send(unsigned char dat){        SBUF = dat;        while(!TI);        TI = 0;       }</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10612.html">
						<title>Re: UART 8051 - Read data</title>
						<link>http://www.8051projects.net/forum-t10612.html</link>
						<dc:date>2009-01-07T17:58:31-08:00</dc:date>
						<dc:creator>say2paul</dc:creator>
						<dc:subject></dc:subject>
						<description>Its fact... and its difficult to follow C Standards...But I will get use to it</description>
						</item>
				</rdf:RDF>