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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/20/02 03:28
Read: times


 
#26038 - PCF8591 (lots of source code)
I have a couple of Philips PCF8591 ADCs connected to an I2C bus. I've tested the voltage levels of the bus, 4.5v when HIGH, 0.4v when low, so they are at acceptable values.

I've read the application notes, and have followed them to my best ability, but I'm not getting any results from the chip.

Here are my pin connections for the 8591:
Pin #1 - Analog In 0 - the voltage i want to convert
Pin #2 through Pin #4 - grounded
Pin #5 through Pin #7 - grounded because this is my programmable address ie, 000
Pin #8 - Vss - grounded
Pin #9 - SDA - goes to P1.7 on 8051
Pin #10 - SCL - goes to P1.6 on 8051
Pin #11 - OSC - left open
Pin #12 - EXT - grounded
Pin #13 - AGND - grouned
Pin #14 - Vref - goes to VDD, +5V
Pin #15 - Aout - not used for now
Pin #16 - VDD - +5V

VDD comes from a 7805,so it should be somewhat clean. Also, I'm treating my analog ground and digitial ground as the same thing, could that be what's messing me up?

The problem is no matter what voltage I put on Pin #1, I always get 0xff when I read the bus.

here is my read function

char ADC_read(int channel)
{
unsigned char idata result = 0;

I2C_start();

if( !I2C_write(ADC_ID|ADC_ADDR|WRITE) )
{
printf("Did not get an ack from PCF8591rn");
return 0;
}

if( !I2C_write(ADC_CTRL|channel) )
{
printf("Did not get an ackrn");
return 0;
}

I2C_read();

result = I2C_read();
I2C_nack();
I2C_stop();

return result;
}

If I need to give more information (source,circuit,etc) let me know and i'll be happy to post more.

Regards,
Christohper Pope.

List of 2 messages in thread
TopicAuthorDate
PCF8591 (lots of source code)            01/01/70 00:00      
RE: PCF8591 (lots of source code)            01/01/70 00:00      

Back to Subject List