<?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 11:59:58 -0800</pubDate>
				<lastBuildDate>Mon, 01 Dec 2008 11:59:58 -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>Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[Hi guys, I've been having problems getting my 8052 to communicate serially. I have a handmade board with a  max 232 and 8052 and other supporting circuitry.<br /><br />I am trying to use windows (xp) hyper terminal to send/ receive data serially.<br />This is what I do to setup hyperterm:<br />New connection(enter some name)>select com1>Properties(bits per sec=9600,data bits=8,parity=none,stop bits=1,flow control=none)> Now we have a window with a cursor thats blinking.<br /><br />Then I  go to File>Properties >and under ascii settings I say echo typed characters locally<br /><br />The program I have written sends the word ALOHA continuously at 9600 bits per sec to the serial port( see code). It simulates correctly in keil micro vision 3 and I can see that it sends ALOHA continuously in the serial window.<br /><br />My hardware seems to be fine- to test it I short the Tx and Rx pins (10 and 11) after removing the microcontroller from its zif socket in my board and type something in hyper term and it echoes back. So max 232 seems to be fine.<br /><br />despite doing this I  have had no luck <img src='http://www.8051projects.net/e107_images/emotes/yahoo/2.gif' alt='' style='vertical-align:middle; border:0' />   Am I doing something wrong or stupid?  Any help would be very much appreciated. This thing is driving me nuts!<br /><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;reg52.h&gt; //</span><br /><br /><span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">void</span><span style="color: #66cc66;">&#41;</span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//main function</span><br /><span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> sdat<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;ALOHA&quot;</span><span style="color: #66cc66;">&#125;</span>;<br />&nbsp; &nbsp; <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> m;<br />&nbsp; &nbsp; &nbsp; &nbsp; TMOD=0x21;<br />&nbsp; &nbsp; TH1=0xFD; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* 9600 baud rate*/</span><br />&nbsp; &nbsp; SCON=0x50; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* 8 bit uart&nbsp; &nbsp; &nbsp; &nbsp; */</span><br />&nbsp; &nbsp; &nbsp; &nbsp; IP=0x32; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* highest priority to serial int*/</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; TR1=<span style="color: #cc66cc;">1</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">//start serial data timer</span><br />&nbsp; &nbsp; &nbsp; &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;TI=<span style="color: #cc66cc;">0</span>; <span style="color: #808080; font-style: italic;">//clear flag</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>m=<span style="color: #cc66cc;">2</span>;m&lt;<span style="color: #cc66cc;">5</span>;m++<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> SBUF=sdat<span style="color: #66cc66;">&#91;</span>m<span style="color: #66cc66;">&#93;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>TI==<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">//wait till byte is txed</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TI=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><br /><span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">// belongs to main&nbsp; &nbsp; &nbsp; </span><br /><br />&nbsp;</div></div> <br />]]></description>
<pubDate>Thu, 03 Jul 2008 02:10:06 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[Change TMOD value to 0x20.<br />Are you using a 11.0592 MHz xtal?<br />Is your micro working at all?Insert a small led blinky in your code and see if the led blinks... this would confirm that the 8052 is indeed working.]]></description>
<author>sashijoseph&lt;sashijoseph@nospam.com&gt;</author>
<pubDate>Thu, 03 Jul 2008 05:09:33 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[yikes! my mistake..the db9 pin no 5 wasnt grounded <img src='http://www.8051projects.net/e107_images/emotes/yahoo/10.gif' alt='' style='vertical-align:middle; border:0' />  thank you for the reply <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />ok..but I still have a problem. Now that my MCU works fine (its now displaying data in hyper term) I want to write a short program on my pc to send data to my MCU. using C doesnt work (outportb()) since i am using win xp. I dont have win 98 or 95 and dont want to install it either... is there a way to "unlock" the ports on my comp so that i can use them in a c  program  i write while using xp?]]></description>
<author>zen bEaR&lt;shakirfm@nospam.com&gt;</author>
<pubDate>Thu, 03 Jul 2008 10:07:47 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[there is something called porttalk which unlocks your ports. <br /><br />Porttalk Driver download:<br /><a class='bbcode' href='http://www.8051projects.net/out.php?link=http://www.beyondlogic.org/porttalk/porttalk.htm' rel='external'  target='_blank'>http://www.beyondlogic.org/porttalk/porttalk.htm</a><br /><br />Porttalk installation info (can also be found on download page):<br /><a class='bbcode' href='http://www.8051projects.net/out.php?link=http://www.qsl.net/dl4yhf/winpic/install_porttalk.htm' rel='external'  target='_blank'>http://www.qsl.net/dl4yhf/winpic/install_porttalk.htm</a><br /><br />]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Thu, 03 Jul 2008 22:41:06 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[well TMOD just configure your timers,<br /><br />20 means Timer 1 mode 2 and Timer 0 mode 0<br /><br />21 means Timer 1 mode 2 and Timer 0 mode 1<br /><br />timers will only get activated when u set their corresponding Timer Run Control Bit (TRx)]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Thu, 31 Jul 2008 08:10:55 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[Why to change TMOD value to 0x20? <br /><br />I am using TMOD 0x21 instead, please let me know what is the difference?]]></description>
<author>say2paul&lt;say2paul@nospam.com&gt;</author>
<pubDate>Thu, 31 Jul 2008 01:43:10 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[Hi Say2 paul,<br /><br />there is a lot of difference ! <br /><br />with TMOD as 20H(0x20), you are using timer1 in mode2 ( 8 bit) auto reload  mode to generate baudrate and  timer0 is not initialized (not used/set)<br /><br />with TMOD as 21H(0x21), timer1 is used as above and timer0 is also used but in mode1( 16 bit )<br /><br /><br />hope you got the idea !<br /><br /><br />Arun]]></description>
<author>Arun Kumar V&lt;nura1002003@nospam.com&gt;</author>
<pubDate>Thu, 31 Jul 2008 03:25:53 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[<div class='quote_top'>say2paul wrote ...</div><div class='quote'><br />mmm a bit <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />But I tried my code with both 20H and 21H and it is working fine with 9600 bps.<br /><br />So unable to find the difference <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /></div><br /><br />hi say to paul,<br />by changing the TMOD from 20h to 21h, u are changing the configuration of the timer0 only,but ur serial baud rate is determined by timer1 and is independent of timer0 configuration. so u did not find the difference. <br />u will find the difference only when u are using the timer0 for some other purpose.]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Thu, 31 Jul 2008 08:44:17 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[mmm a bit <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />But I tried my code with both 20H and 21H and it is working fine with 9600 bps.<br /><br />So unable to find the difference <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>say2paul&lt;say2paul@nospam.com&gt;</author>
<pubDate>Thu, 31 Jul 2008 07:05:18 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
						<item>
						<title>Re: Problems with serial data</title>
<link>http://www.8051projects.net/forum-t10557.html</link>
<description><![CDATA[<div class='quote_top'>pdi33 wrote ...</div><div class='quote'><br /><div class='quote_top'>say2paul wrote ...</div><div class='quote'><br />mmm a bit <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />But I tried my code with both 20H and 21H and it is working fine with 9600 bps.<br /><br />So unable to find the difference <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /></div><br /><br />hi say to paul,<br />by changing the TMOD from 20h to 21h, u are changing the configuration of the timer0 only,but ur serial baud rate is determined by timer1 and is independent of timer0 configuration. so u did not find the difference. <br />u will find the difference only when u are using the timer0 for some other purpose.<br /></div><br /><br /><br />Thanks pdi33, now I got it <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>say2paul&lt;say2paul@nospam.com&gt;</author>
<pubDate>Fri, 01 Aug 2008 06:48:59 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10557.html</guid>
</item>
				</channel>
				</rss>