This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problems in Interfacing ADC and 89C51

Hi,
I'm a 3rd year undergrad student in ECE.
I'm trying to interface an ADC0809 with Atmel 89C51.
The adc is working fine, it gives proper digital output for all values from 0-5V.The adc is configured in continuous conversion mode. I'm trying to read the output of the ADC through port 1 of 8051, but I see that the port1 is not reading the digital output. I'm not able to figure out what could be the problem.
I wrote a small test program to check if P1 is taking the data.

MOV P1,#0FFH ;config as input MOV P0,#00H ;SELECT CHANNEL 0 LOOP: MOV A,P1 ; READ CONTENTS FROM P1 MOV P3,A ;SEND TO P3 ACALL DELAY SJMP LOOP

After running this program P3 remains FFh all the time. The data is arriving correctly at the input port, double checked with multimeter.

1. I've configured P1 as input, MOV P1,#0FFH. did not forget that..

2. I'm using a 220V AC to 5V DC adaptor, current rating is 500mA.

3. The clock to the ADC0809 is 100KHZ and is generated from the controller itself P2.0

4. To check if Port1 is working fine I connected few pins of P1 to VCC through 1k resistor and others to GND and ran the same program. IT WORKS FINE THAT TIME. P3 contains same data as P1. Then how come data from the adc is not read!!!!

I've thought of all possible problems. Looking at it from a logical standpoint it should and must work. Everything seems to be fine.

I would greatly appreciate help in this matter.

0