turjasu
Newbie level 3

Hello friends,
Im new to this forum...But Im with a serious problem.
I have the intention of displaying digital byte value, read by the ADC PCF8591P to an output port of 89C51. For that I have done the interfacing
of pcf8591p with the AT898C51 through P1.0 = sda and P1.1=SCL and have done the programming. It is attached with this post in .txt format.
However, i will still explain once:
1. I send a Start condition
2. i send hex value 90h for address with A0=A1=A2=0 and r/w'=0
3. i sense ack frm pcf
4. i send 40h for activating dac
5. i wait for ack
6. i send a dummy write byte 00h to output in dac
7. i wait for ack
8. i send stop
now comes the reading routine
1. i send start
2. i send 91h for r/w'=1 for read
3. i wait for ack
4. i read databyte
5. i send master not-ack for last read
6. i read databyte again since first byte is useless
7. i send ack again from mcu to pcf8591p
8. i move the value in accumulator, read previously from pcf to port 0
9. i send stop
Now the problem is that whenever Im moving the read data, I always get 00H at the port. infact i have checked, pcf always gives to mcu 00hex
value, not the converted value. the dac part is fine. i checked it with other values, its working fine. the entire program is also executing
properly, which i have checked out. Please help me, If i am missing any command in the program, or managing the I2C routines improperly. I have
used Assembly language. I have attached the entire program.
Im new to this forum...But Im with a serious problem.
I have the intention of displaying digital byte value, read by the ADC PCF8591P to an output port of 89C51. For that I have done the interfacing
of pcf8591p with the AT898C51 through P1.0 = sda and P1.1=SCL and have done the programming. It is attached with this post in .txt format.
However, i will still explain once:
1. I send a Start condition
2. i send hex value 90h for address with A0=A1=A2=0 and r/w'=0
3. i sense ack frm pcf
4. i send 40h for activating dac
5. i wait for ack
6. i send a dummy write byte 00h to output in dac
7. i wait for ack
8. i send stop
now comes the reading routine
1. i send start
2. i send 91h for r/w'=1 for read
3. i wait for ack
4. i read databyte
5. i send master not-ack for last read
6. i read databyte again since first byte is useless
7. i send ack again from mcu to pcf8591p
8. i move the value in accumulator, read previously from pcf to port 0
9. i send stop
Now the problem is that whenever Im moving the read data, I always get 00H at the port. infact i have checked, pcf always gives to mcu 00hex
value, not the converted value. the dac part is fine. i checked it with other values, its working fine. the entire program is also executing
properly, which i have checked out. Please help me, If i am missing any command in the program, or managing the I2C routines improperly. I have
used Assembly language. I have attached the entire program.