Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/07/03 09:44
Read: times


 
#54257 - Problem in Reading the O/P of an ADC0804
Hi
I have connect an ADC0804 to an AT89c52 to port P1 and the RD,WR, INT to P2. and the output is display on digtial trainner but If I increase the IN voltage to the ADC the display is not changing. The following is the code i am using Keil can any tell what is the problem

#include<reg51.h>
xdata unsigned char var _at_ 0x9000;


void display();
void adc();


main()
{



P1=0xFF;

while(1)
{
adc();
}
}

void adc()

{
P2=0x00;
P2=0x40;
if(P2==0x80)
{
P2=0x00;
var=P1;
display();
P2=0x20;

}


}


void display()
{
#pragma asm
push dph
push dpl
push acc
push b

mov dptr,#9000h
movx a,@dptr
mov 60h,a
lcall 019bh
pop b
pop acc
pop dpl
pop dph
#pragma endasm

}



List of 4 messages in thread
TopicAuthorDate
Problem in Reading the O/P of an ADC0804            01/01/70 00:00      
   RE: Problem in Reading the O/P of an ADC0804            01/01/70 00:00      
   RE: Problem in Reading the O/P of an ADC            01/01/70 00:00      
   RE: Problem in Reading the O/P of an ADC0804            01/01/70 00:00      

Back to Subject List