<?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 20:12:35 -0800</pubDate>
				<lastBuildDate>Thu, 08 Jan 2009 20:12:35 -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>how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[hi i'm a newbie in this one. can anyone help me with this? i'm using miKroC  for programming the microcontroller. now i want to display the readings of the micocontroller in visual basic. for example i have a voltage output 4v read by the ucontroller and want to display the digital output in visual basic... thank you very much for sparing your time...]]></description>
<pubDate>Sat, 16 Feb 2008 00:41:05 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[help needed urgently... why the code for my microcontroller wont detect a voltage? the leds don't turn on when i put 3vs as an analog input. everyone help me? and then the vb code for displaying the reading...]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 01 Mar 2008 22:24:05 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[@Norms<br />Can you explain your project in some detail(mainly the algo)....<br />As for the C program some things look suspect.....<br /> <div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;">norms = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2.5</span> *<span style="color: #cc66cc;">1023</span><span style="color: #66cc66;">&#41;</span>/<span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;</div></div> <br />Now why would you do that?Why not simply 'norms=511',which is the value you get from that computation.<br />And what is 'volts_out'?Are you reading in some value from the serial port?<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: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>volts_out==get_adc<span style="color: #66cc66;">&#41;</span></div></div> <br />You haven't initialised get_adc,so you're in effect comparing volts_out to garbage.]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 17 Feb 2008 10:10:10 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[send the value to PC using UART and then display it in VB software after reading from COM port. All you need to do is COM port programming in Visual Basic (search forum for more information)]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 01:01:55 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[this is my c program for microcontroller... any help or suggestion? it doestn have an error though<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: #993333;">unsigned</span> <span style="color: #993333;">int</span> volts_out;<br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> get_adc;<br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> x;<br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> norms;<br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> value;<br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> temp1;<br /><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> temp2;<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 />&nbsp;<span style="color: #993333;">int</span> exit = <span style="color: #cc66cc;">1</span>;<br />&nbsp;Usart_Init<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">9600</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp;ADCON0 = 0x80;<br />&nbsp;ADCON1 = 0x80;<br />&nbsp;ADCON0.<span style="color: #202020;">ADON</span> = <span style="color: #cc66cc;">1</span>; <span style="color: #808080; font-style: italic;">// Enables A/D Conversion</span><br />&nbsp;TRISB = <span style="color: #cc66cc;">0</span>;<br />&nbsp;PORTB = <span style="color: #cc66cc;">0</span>;<br />&nbsp;RCSTA = 0x90;<br />&nbsp;TXSTA = 0x24;<br />&nbsp;Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp;<br />&nbsp;<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>;;<span style="color: #66cc66;">&#41;</span><br />&nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Usart_Data_Ready<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; exit=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; PORTB=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; volts_out=Usart_Read<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; norms = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2.5</span> *<span style="color: #cc66cc;">1023</span><span style="color: #66cc66;">&#41;</span>/<span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>volts_out==norms<span style="color: #66cc66;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;">// Within the 240-220 voltage range</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;x = volts_out * <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span>/<span style="color: #cc66cc;">1023</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">do</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F2</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F3</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F4</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F5</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Usart_Data_Ready<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>exit<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>volts_out&gt;norms<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">// Greater than 240 Volts</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; x = volts_out * <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span>/<span style="color: #cc66cc;">1023</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">do</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F2</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F3</span>=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F4</span>=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F5</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Usart_Data_Ready<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>exit<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>volts_out&lt;norms<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; x = volts_out * <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span>/<span style="color: #cc66cc;">1023</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">do</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F2</span>=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F3</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F4</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F5</span>=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Usart_Data_Ready<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>exit<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>volts_out==get_adc<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">do</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADRESH=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADRESL=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F1</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADCON0.<span style="color: #202020;">GO</span>=<span style="color: #cc66cc;">1</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value=Adc_Read<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp1=ADRESH;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp2=ADRESL;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTB.<span style="color: #202020;">F1</span>=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Eeprom_Write<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,temp1<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Eeprom_Write<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,temp2<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Usart_Write<span style="color: #66cc66;">&#40;</span>Eeprom_Read<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Usart_Write<span style="color: #66cc66;">&#40;</span>Eeprom_Read<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Usart_Data_Ready<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>exit<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; PORTB=0xff;<br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp;<br /><span style="color: #66cc66;">&#125;</span><br />&nbsp;</div></div>]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 01:21:45 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[how i am going to display the read value in visual basic in digital form? <img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 01:23:04 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[how actually you are displaying your ADC output and where?<br /><br />also what do you mean by digital form? can you explain with example?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 04:20:21 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[the x = .... is the one i will be calling in the visual basic... <br />i mean decimal value, sorry... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 06:16:09 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[consider you have value=56 in microcontroller...now convert decimal to a string. and send seriially to vb.<br />it that wat you want <img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 06:48:55 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[Do you mean something like this:<br /><img src='http://www.8051projects.net/e107_files/public/1203183057_6071_FT5905_battmon.gif' class='bbcode' alt='' width='424' height='389'  />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 09:31:35 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[<div class='quote_top'>abbas1707 wrote ...</div><div class='quote'><br />consider you have value=56 in microcontroller...now convert decimal to a string. and send seriially to vb.<br />it that wat you want <img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />  <br /></div><br /><br /><br />yup...<br /><br />this is how i am going to convert<br /><br />2.5v is the output read from a certain load then i'll convert it to decimal like this:<br /><br />norms = (( 2.5 *1023)/5);<br /><br />then ill have this declaration:<br /><br />if (volts_out==norms)<br /><br />//ill convert the decimal to a voltage value <br /><br />x = (volts_out * (5))/1023 // this is the voltage that ill be calling to the visual basic program, am i right?<br /><br />in vb<br /><br />the value of x will be multiply to the ratio of the transformer like this<br /><br />y = (x*220)/5 <br /><br />so y is the final value that i will like to be display in vb...<br /><br />so is it ok?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 08:37:29 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[yup but the voltage vill be converted to 220v from 8.7 for example. so insted of 8.7v in display it will now display 220V]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 10:10:27 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[<div class='quote_top'>GioppY wrote ...</div><div class='quote'><br />Hi.<br />I have attached the vb6 source code and the exe.<br />It communicate by one of the available com port on your pc @ 2400 baud,n,8,1<br />It wait for a string in the following format xx,xCR  (CR means carriage return) where xx,x is a numeric value in the 00,0 to 19,9 range (please note the comma).<br />When receive the string it display the value (the string as received) and plot a graphic representation; after 128 samples the plot is erased and restarted.<br />It wait for a string every second; i do not know if it can handle higher sample rate. <br />Obviously you have to modify the code for your requirement.<br />Regards<br />Gianni<br />P.S.<br />220v ??? I hope that you use a transformer to REDUCE and ISOLATE the mains from the pic and from the pc<br /><a href='http://www.8051projects.net/e107_files/public/1203189971_6071_FT5905_batt_mon.zip'><img src='http://www.8051projects.net/e107_images/generic/lite/file.png' alt='' style='border:0; vertical-align:middle' /></a> <a href='http://www.8051projects.net/e107_files/public/1203189971_6071_FT5905_batt_mon.zip'>batt_mon.zip</a><br /></div><br /><br />Gioppy can you check my c program for microcontroller if its correct? thanks]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 22:25:06 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[<div class='quote_top'>GioppY wrote ...</div><div class='quote'><br />Do you mean something like this:<br /><img src='http://www.8051projects.net/e107_files/public/1203183057_6071_FT5905_battmon.gif' class='bbcode' alt='' width='424' height='389'  /><br /></div><br /><br /><br />can you teach mo how? like to ask for your code on that... please]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 10:14:10 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[Hi.<br />I have attached the vb6 source code and the exe.<br />It communicate by one of the available com port on your pc @ 2400 baud,n,8,1<br />It wait for a string in the following format xx,xCR  (CR means carriage return) where xx,x is a numeric value in the 00,0 to 19,9 range (please note the comma).<br />When receive the string it display the value (the string as received) and plot a graphic representation; after 128 samples the plot is erased and restarted.<br />It wait for a string every second; i do not know if it can handle higher sample rate. <br />Obviously you have to modify the code for your requirement.<br />Regards<br />Gianni<br />P.S.<br />220v ??? I hope that you use a transformer to REDUCE and ISOLATE the mains from the pic and from the pc<br /><a href='http://www.8051projects.net/e107_files/public/1203189971_6071_FT5905_batt_mon.zip'><img src='http://www.8051projects.net/e107_images/generic/lite/file.png' alt='' style='border:0; vertical-align:middle' /></a> <a href='http://www.8051projects.net/e107_files/public/1203189971_6071_FT5905_batt_mon.zip'>batt_mon.zip</a>]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 11:27:42 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[thanks... yup i am using a transformer to step down the voltage then have some declarations equating 220=2.5 volts... thank you very much...]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 16 Feb 2008 11:39:47 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[Sorry! I do not know C language. I use picbasic.<br />Regards]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 17 Feb 2008 07:56:04 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[volts_out is the value read from the output of the load...  its not from the serial port... hehehe, i just want to show the computation so any man know how i get the 511 value... so is the program ok?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 18 Feb 2008 01:14:00 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[Except for get_adc value rest seems ok.<br />btw what is the get_adc for?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 18 Feb 2008 09:24:35 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[its for getting the reading from the load... like the decimal value and as well as the digital value...]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 19 Feb 2008 02:24:48 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[heres my vb code: please and kindly check it. thanks<br /><br /><div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="vb" style="font-family: monospace;"><span style="color: #b1b100;">Private</span> <span style="color: #b1b100;">Sub</span> CmdExit_Click<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">If</span> MSComm1.<span style="color: #66cc66;">PortOpen</span> = <span style="color: #b1b100;">True</span> <span style="color: #b1b100;">Then</span><br />&nbsp; &nbsp; MSComm1.<span style="color: #66cc66;">PortOpen</span> = <span style="color: #b1b100;">False</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span><br /><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span><br /><span style="color: #b1b100;">Private</span> <span style="color: #b1b100;">Sub</span> Form_Load<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; MSComm1.<span style="color: #66cc66;">InputLen</span> = <span style="color: #cc66cc;">0</span><br />&nbsp; &nbsp; MSComm1.<span style="color: #66cc66;">CommPort</span> = <span style="color: #cc66cc;">1</span><br />&nbsp; &nbsp; MSComm1.<span style="color: #66cc66;">Settings</span> = <span style="color: #ff0000;">&quot;2400,N,8,1&quot;</span><br /><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span><br /><span style="color: #b1b100;">Private</span> <span style="color: #b1b100;">Sub</span> Timer1_Timer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> BytesToRead <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> norms <span style="color: #b1b100;">As</span> Variant<br />&nbsp; &nbsp; MSComm1.<span style="color: #66cc66;">PortOpen</span> = <span style="color: #b1b100;">True</span><br />&nbsp; &nbsp; BytesToRead = <span style="color: #cc66cc;">1</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">Do</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">DoEvents</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Loop</span> Until MSComm1.<span style="color: #66cc66;">InBufferCount</span> = BytesToRead<br />&nbsp; &nbsp; &nbsp; &nbsp; norms = MSComm1.<span style="color: #b1b100;">Input</span><br />&nbsp; &nbsp; &nbsp; &nbsp; Text1.<span style="color: #66cc66;">Text</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">Asc</span><span style="color: #66cc66;">&#40;</span>norms<span style="color: #66cc66;">&#41;</span> * <span style="color: #cc66cc;">0.01</span><span style="color: #66cc66;">&#41;</span> * <span style="color: #cc66cc;">230</span><span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;">2.5</span><span style="color: #66cc66;">&#41;</span> &amp; <span style="color: #ff0000;">&quot; Volts AC&quot;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MSComm1.<span style="color: #66cc66;">PortOpen</span> = <span style="color: #b1b100;">False</span><br /><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span><br />&nbsp;</div></div>]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 21 Feb 2008 22:56:55 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[i need to see the circuit atleast.. <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>Sun, 02 Mar 2008 06:35:03 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[On close examination of your code,this is the logic I figured out.....<br /><br />for(;;)<br />{<br />if(usart receive buffer is full)...read usart....volts_out=value read<br />    {   if(volts_out=511)....light up some leds and loop till receive buffer is full again <br />           elseif(volts_out&lt;511)....light up some leds and loop till receive buffer is full again<br />      elseif(volts_out>511)....light up some leds and loop till receive buffer is full again<br />      elseif(volts_out=get_adc)...read adc value,store it in EEPROM,read the stored<br />                                                   EEPROM value and send it to USART<br />     }<br />else...PORTB=0xFF<br />}<br /><br />Instead of the ADC you are reading in the value "Volts_out" from the USART....why?<br />Moreover you need to send in some value from the PC to the USART in order for the 1st ' if' statement to trigger.(if(usart receive buffer is full))<br />And then the variable get_adc...you are comparing volts_out to it before providing it with an initial value(you've only declared it "unsigned int get_adc;",not initialised it).<br /><br />Look at the code below...this is how it should be.<br /><br />unsigned int adc_val;<br />unsigned char volts_out;<br /><br />void main() <br />{<br />  USART_Init(9600); <br />  ADCON1 = 0x80;        <br />  TRISA  = 0xFF;     // PORTA is input<br />  TRISB  = 0;        // PORTB is output      <br />  PORTB  = 0;<br /><br /><br /> while (1)<br />  {<br />    adc_val = ADC_Read(2);<br />    volts_out = adc_val * 5/1023;<br />    USART_Write(volts_out);<br />    if(adc_val==511)<br />      {PORTB = 0xFF;}<br />    else if(adc_val&lt;511)<br />      {PORTB = 0x0F;}<br />    else<br />      {PORTB = 0xF0;}<br />    Delay_ms(5000);<br />  }   <br />   <br />}]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 02 Mar 2008 12:04:22 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[my vb code... please check and correct it... thank you very much guys...<br /><br />Private Sub CmdExit_Click()<br />    If MSComm1.PortOpen = True Then<br />    MSComm1.PortOpen = False<br />    End If<br />        End<br />End Sub<br />Private Sub Form_Load()<br />    MSComm1.InputLen = 0<br />    MSComm1.CommPort = 1<br />    MSComm1.Settings = "2400,N,8,1" <br />End Sub<br />Private Sub Timer1_Timer()<br />    Dim BytesToRead As Integer<br />    Dim adc As Variant<br />    MSComm1.PortOpen = True<br />    BytesToRead = 1<br />    Do<br />        DoEvents<br />        Loop Until MSComm1.InBufferCount = BytesToRead<br />        adc = MSComm1.Input<br />        Text1.Text = (((Asc(adc) * 0.01) * 230) / 2.5) &amp; " Volts AC" <br />        MSComm1.PortOpen = False<br />End Sub]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 02 Mar 2008 23:48:48 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[at this moment my current code for my microcontroller 16F877, please correct it and write the code if you don't mind... please... really reallly need it. <br /><br />void main()<br />{<br /> int limit = 512;<br /> int vout;<br /> int adc;<br /> int x;<br /> int value;<br /> int temp1;<br /> int temp2;<br /> int exit = 1;<br /><br /> Usart_Init(2400);<br /> ADCON0 = 0x80;<br /> ADCON1 = 0x80;<br /> ADCON0.ADON = 1; // Enables A/D Conversion<br /> TRISB = 0;<br /> PORTB = 0;<br /> RCSTA = 0x90;<br /> TXSTA = 0x24;<br /> Delay_ms(100);<br /><br /> for(;;)<br />  {<br />    if(Usart_Data_Ready())  <br />    {<br />      exit=1;<br />      PORTB=0;<br />      vout=Usart_Read();<br />      Delay_ms(100);<br /><br />      if(vout == 512)  // Within the 240 Voltage Range, equal to 2.5 volts<br />      {<br />       do<br />       {<br />          PORTB.F1 = 1;<br />          PORTB.F2 = 1;<br />          PORTB.F3 = 1;<br />          PORTB.F4 = 1;<br />          PORTB.F5 = 1;<br />          PORTB.F6 = 1;<br />          PORTB.F7 = 1;<br />          Delay_ms(1000);<br />          if(Usart_Data_Ready())<br />          {<br />            exit=0;<br />          }<br />        }<br />        while(exit);<br />      }<br />      else if(vout > 512) // Greater than 240 Volts, greater than 2.5 volts<br />      {<br />        do<br />        {<br />            PORTB.F1 = 1;<br />            PORTB.F3 = 1;<br />            PORTB.F5 = 1;<br />            PORTB.F7 = 1;<br />            Delay_ms(1000);<br />            if(Usart_Data_Ready())<br />          {<br />            exit=0;<br />          }<br />        }<br />        while(exit);<br />      }<br />      else if (vout &lt; 512) // Less than 240 volts, less than 2.5 volts<br />      {<br />       do<br />       {<br />           PORTB.F2 = 0;<br />           PORTB.F4 = 0;<br />           PORTB.F6 = 0;<br />           Delay_ms(1000);<br />           if (Usart_Data_Ready())<br />           {<br />            exit = 0;<br />           }<br />       }<br />       while(exit);<br />      }<br />      else if (vout == 0)<br />      {<br />       do<br />       {<br />        PORTB.F1=0;<br />        PORTB.F2=0;<br />        PORTB.F3=0;<br />        PORTB.F4=0;<br />        PORTB.F5=0;<br />        PORTB.F6=0;<br />        PORTB.F7=0;<br />        if(Usart_Data_Ready())<br />        {<br />         exit=0;<br />        }<br />       }<br />       while(exit);<br />      }<br />      else if(vout == adc)  <br />      {<br />        do<br />        {<br />          ADRESH=0;<br />          ADRESL=0;<br />          ADCON0.GO=1;<br />          Delay_ms(100);<br />          value=Adc_Read(0);<br />          Delay_ms(100);<br />          exit=0;<br />          temp1=ADRESH;<br />          temp2=ADRESL;<br />          Delay_ms(1000);<br />          Eeprom_Write(0,temp1);<br />          Delay_ms(20);<br />          Eeprom_Write(1,temp2);<br />          Delay_ms(70);<br />          Usart_Write(Eeprom_Read(0));<br />          Delay_ms(20);<br />          Usart_Write(Eeprom_Read(1));<br />          Delay_ms(50);<br />          if(Usart_Data_Ready())<br />          {<br />            exit=0;<br />          }<br />        }<br />        while(exit);<br />      }<br />    }<br />    else<br />    {<br />      PORTB=0xff;<br />    }<br />  }<br />}<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 02 Mar 2008 23:46:55 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[this is my circuit<br /><a class='bbcode' href='http://www.8051projects.net/e107_files/public/1204531758_6079_FT5905_myckt.jpg' rel='external'  target='_blank'><img src='http://www.8051projects.net/e107_files/public/1204531758_6079_FT5905_myckt_.jpg' class='bbcode' alt='' width='500' height='299'  /></a><br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 03 Mar 2008 00:09:18 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[the Tx and Rx were put incorrectly... Rx should in the Tx place...]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 03 Mar 2008 00:32:06 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[<div class='quote_top'>sashijoseph wrote ...</div><div class='quote'><br />Like I pointed out ealier your PIC code won't work.For eg.<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: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Usart_Data_Ready<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div></div> <br />why are you checking the (PIC's) serial port input buffer?Are you sending sth into the PIC's serial port?If not then why use this check?<br /><br />Then you have    <div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;">vout=Usart_Read<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></div> <br />You should be getting the value from the ADC rather than the serial port.<br /><br />Similarly there are plenty of flaws.......<br /><br />Look at the code below.This is all you need to read in ADC value and send it as two bytes to the PC's serial port.<br /><br />unsigned int adc_val;<br />unsigned char low_byte,hi_byte;<br />void main() <br />{<br />  USART_Init(9600); <br />  ADCON1 = 0;        <br />  TRISA  = 0xFF;     // PORTA is input<br />  TRISB  = 0;        // PORTB is output      <br />  PORTB  = 0;<br /><br /> while (1)<br />  {<br />    adc_val = ADC_Read(2);   //get ADC value<br />    low_byte = adc_val;      //split the 2-byte integer into 2 separate bytes<br />    hi_byte = adc_val >> 8;  //for sending to pc serial port<br />    USART_Write(low_byte);   //send the 1st (lower) byte<br />    USART_Write(hi_byte);    //send the upper byte<br />    if(adc_val==511)         //if ADC value read in is 511 <br />      {PORTB = 0xFF;}        //display some LED's on PORTB<br />    else if(adc_val&lt;511)<br />      {PORTB = 0x0F;}<br />    else<br />      {PORTB = 0xF0;}<br />    Delay_ms(5000);          //gather a sample after 5 secs.<br />  }    <br />}<br /></div><br /><br />what happened to the USART_Write(volts_out)? in your first correction you have it, then now its gone, replace by the low and high byte... please enlightened me with this...<br /><br />then in my vb pro, do i need to change the BytesToRead = 1 to 2? and then the "adc=MSComm1.Input"<br />what will be my input here?  thanks]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 03 Mar 2008 23:35:55 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[heres my code and its working, i can light the leds now..... hope you can add the necessary codes for transmitting the signal to the serial port... pls help...<br /><br /><br />void main()<br />{<br />  int limit=512;<br />  int value;<br />  TRISA=0xff; // Configure PORTA as analog input<br />  TRISB=0; // Configure PORTB as output<br />  PORTA=0;<br />  PORTB=0;<br />  ADCON0=0b10000000;<br />  ADCON1=0b10001110;<br />  ADCON0.ADON=1; // Enable ADC<br />  for(;;)<br />  {<br />    ADCON0.GO=1;<br />    Delay_us(10);<br />    value=Adc_Read(0);<br />    if(value>=512) // value is greater or equal to 2.5V<br />    {<br />      PORTB.F0=1;<br />      PORTB.F2=1;<br />      PORTB.F4=1;<br />      PORTB.F6=1;<br />      Delay_ms(100);<br />      PORTB.F0=0;<br />      PORTB.F2=0;<br />      PORTB.F4=0;<br />      PORTB.F6=0;<br />      Delay_ms(100);<br />    }<br />    else if(value&lt;512)<br />    {<br />      PORTB.F1=1;<br />      PORTB.F3=1;<br />      PORTB.F5=1;<br />      PORTB.F7=1;<br />      Delay_ms(100);<br />      PORTB.F1=0;<br />      PORTB.F3=0;<br />      PORTB.F5=0;<br />      PORTB.F7=0;<br />      Delay_ms(100);<br />    }<br />    Delay_ms(3000);<br />  }<br />}<br /><br /><br /><br />and pls help me in my vb program... here is my first vb program...<br /><br />Private Sub CmdExit_Click()<br />    If MSComm1.PortOpen = True Then<br />    MSComm1.PortOpen = False<br />    End If<br />        End<br />End Sub<br />Private Sub Form_Load()<br />    MSComm1.InputLen = 0<br />    MSComm1.CommPort = 1<br />    MSComm1.Settings = "9600,N,8,1" <br />End Sub<br />Private Sub Timer1_Timer()<br />    Dim BytesToRead As Integer<br />    Dim value As Variant<br />    MSComm1.PortOpen = True<br />    BytesToRead = 1<br />    Do<br />        DoEvents<br />        Loop Until MSComm1.InBufferCount = BytesToRead<br />        value = MSComm1.Input<br />        Text1.Text = (((Asc(value) * 0.01) * 230) / 2.5) &amp; " Volts AC" <br />        MSComm1.PortOpen = False<br />End Sub<br /><br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 04 Mar 2008 09:18:12 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[thanks sashijoseph for the help. appreciate it very much... ill test it tonight ill keep in touchwith you. you save my life...]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 03 Mar 2008 23:11:16 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[Like I pointed out ealier your PIC code won't work.For eg.<br /> <div class=''>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Usart_Data_Ready<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div></div> <br />why are you checking the (PIC's) serial port input buffer?Are you sending sth into the PIC's serial port?If not then why use this check?<br /><br />Then you have    <div class=''>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;">vout=Usart_Read<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></div> <br />You should be getting the value from the ADC rather than the serial port.<br /><br />Similarly there are plenty of flaws.......<br /><br />Look at the code below.This is all you need to read in ADC value and send it as two bytes to the PC's serial port.<br /><br />unsigned int adc_val;<br />unsigned char low_byte,hi_byte;<br />void main() <br />{<br />  USART_Init(9600); <br />  ADCON1 = 0;        <br />  TRISA  = 0xFF;     // PORTA is input<br />  TRISB  = 0;        // PORTB is output      <br />  PORTB  = 0;<br /><br /> while (1)<br />  {<br />    adc_val = ADC_Read(2);   //get ADC value<br />    low_byte = adc_val;      //split the 2-byte integer into 2 separate bytes<br />    hi_byte = adc_val >> 8;  //for sending to pc serial port<br />    USART_Write(low_byte);   //send the 1st (lower) byte<br />    USART_Write(hi_byte);    //send the upper byte<br />    if(adc_val==511)         //if ADC value read in is 511 <br />      {PORTB = 0xFF;}        //display some LED's on PORTB<br />    else if(adc_val&lt;511)<br />      {PORTB = 0x0F;}<br />    else<br />      {PORTB = 0xF0;}<br />    Delay_ms(5000);          //gather a sample after 5 secs.<br />  }    <br />}]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 03 Mar 2008 11:17:40 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[The previous USART_Write(volts_out) would send out the value  volts_out which had been declared as char hence only rounded off values(ie1,2,3,4,5) would be sent instead of say 1.87 or 2.54 etc.It was only for checking proper working.<br />The actual value received by the adc,which is an integer (2bytes) is split into two bytes and sent to the PC as Low_byte and Hi_byte.In the PC you can then 'join' the 2 bytes to the original int and then convert it to the appropriate voltage reading to be displayed. Hope it's clear.<br />I would suggest doing things step by step.First program the PIC and see if the LED's are working correctly.Then use Hyperterminal and check if the serial code is OK.Finally make the VB program.]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 04 Mar 2008 00:00:26 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[thanks.. ill try it tonight...]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 04 Mar 2008 01:37:39 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
						<item>
						<title>Re: how to dispaly the a/d value from PIC16F877 using visual basic in digital value</title>
<link>http://www.8051projects.net/forum-t5905.html</link>
<description><![CDATA[hmm im trying it right now, and it can't light the leds on... does something in my circuit is wrong? the schematic diagram of my pic was posted before here. kindly check it sashjoseph, ive changed the ADCON1 to ADCON0, so the input will be put in AN0 in pin number 2, am i right?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 04 Mar 2008 07:24:22 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t5905.html</guid>
</item>
				</channel>
				</rss>