<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Interfacing ADC0804 with 8051</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/38833/interfacing-adc0804-with-8051</link><description> 
Please provide assembly language code for interfacing Adc0804 with
8051 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Interfacing ADC0804 with 8051</title><link>https://community.arm.com/thread/58234?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2010 07:53:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8c85fc36-1517-4a44-befb-ebc2c533371d</guid><dc:creator>priyank16 kansagara</dc:creator><description>&lt;p&gt;&lt;p&gt;
hi friend i post u my working program which is in c language &amp;amp;
as well as in asembly.......&lt;/p&gt;

&lt;p&gt;
#include&amp;lt;reg51.h&amp;gt;&lt;br /&gt;
#define input P0 //Input port to read the values of ADc&lt;br /&gt;
#define output P2 // Output port, connected to LED&amp;#39;s.&lt;/p&gt;

&lt;p&gt;
sbit wr= P1^1; // Write pin. It is used to start the
conversion.&lt;br /&gt;
sbit rd= P1^0; // Read pin. It is used to extract the data from
internal register to the output pins of ADC.&lt;br /&gt;
sbit intr= P1^2; // Interrupt pin. This is used to indicate the end
of conversion. It goes low when conversion is complete.&lt;/p&gt;

&lt;p&gt;
void delay(unsigned int msec ) // The delay function provides
delay in msec.&lt;br /&gt;
{ int i,j ;&lt;br /&gt;
for(i=0;i&amp;lt;msec;i++) for(j=0; j&amp;lt;1275; j++);&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
void adc() // Function to read the values from ADC and display on
the LED&amp;#39;s.&lt;br /&gt;
{ rd=1;&lt;br /&gt;
wr=0;&lt;br /&gt;
delay(1);&lt;br /&gt;
wr=1;&lt;br /&gt;
while(intr==1);&lt;br /&gt;
rd=0;&lt;br /&gt;
output=input;&lt;br /&gt;
delay(1);&lt;br /&gt;
intr=1;&lt;br /&gt;
} void main()&lt;br /&gt;
{ input=0xff; // Declare port 0 as input port.&lt;br /&gt;
while(1)&lt;br /&gt;
{ adc(); }&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
asembaly language programing&lt;/p&gt;

&lt;p&gt;
RD Bit p3.5&lt;br /&gt;
wr Bit p3.6&lt;br /&gt;
INTR Bit P3.7&lt;/p&gt;

&lt;p&gt;
again: mov p1,#0ffh //configure as i/p port to get 8 bit converted
data&lt;/p&gt;

&lt;p&gt;
mov p0,#00h //configure as o/p port to display our data&lt;/p&gt;

&lt;p&gt;
clr WR&lt;/p&gt;

&lt;p&gt;
setb wr // give low to hige pulse for start convertion&lt;/p&gt;

&lt;p&gt;
back:jb INTR,back // wait for convertion takes place&lt;/p&gt;

&lt;p&gt;
clr RD // to get deta converted&lt;/p&gt;

&lt;p&gt;
mov a,P1&lt;/p&gt;

&lt;p&gt;
mov p0,a // write your rutin for display data&lt;/p&gt;

&lt;p&gt;
setb RD&lt;/p&gt;

&lt;p&gt;
sjmp again&lt;/p&gt;

&lt;p&gt;
end&lt;/p&gt;

&lt;p&gt;
plz send me hardware diagram for this bcoz i am littel confused
with this&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing ADC0804 with 8051</title><link>https://community.arm.com/thread/58236?ContentTypeID=1</link><pubDate>Sun, 13 Jun 2010 05:49:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5a68d9da-a5b7-4af1-aa99-de28f9afb8b6</guid><dc:creator>venkat ramana</dc:creator><description>&lt;p&gt;&lt;p&gt;
send me an email to me.. i will help you sure&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing ADC0804 with 8051</title><link>https://community.arm.com/thread/103986?ContentTypeID=1</link><pubDate>Wed, 26 May 2010 04:29:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4ebca1c5-e2ea-4b17-889f-3940b50dbb25</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing ADC0804 with 8051</title><link>https://community.arm.com/thread/78360?ContentTypeID=1</link><pubDate>Wed, 26 May 2010 02:48:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eb2f1a2d-b736-416d-9730-4ffac013af78</guid><dc:creator>project gvpcoe</dc:creator><description>&lt;p&gt;&lt;p&gt;
madame TAMIR.&lt;/p&gt;

&lt;p&gt;
Please check your address,,,,,. it was refused&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing ADC0804 with 8051</title><link>https://community.arm.com/thread/58229?ContentTypeID=1</link><pubDate>Wed, 26 May 2010 02:37:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9801ce26-7bd0-483d-894f-288ba735b8c0</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
send me an email to:&lt;/p&gt;

&lt;p&gt;
iamalazyloser@yahoo.com !&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>