I2C A/D ADS1013/4/5

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
Is there someone who had work with Texas Instruments I2C A/D ADS1013/4/5 It's make 2 weeks I work on this animal and I can figure what I'm doing wrong. I will be please is someone can help me.

Thanks
Sylvain Bissonnette

Yours truly,
Sylvain Bissonnette
www.microsyl.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No body would be able to figure out what's wrong. Yes there is something wrong with the procedure but we need to know the procedure. More details needed.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I try to read the ADC convertion value and I have nothing good, the value never change, here is what I do

SoftI2CInit();

SoftI2CStart();
SoftI2CWriteByte(0x90);
SoftI2CWriteByte(0x01);
SoftI2CWriteByte(0x00);
SoftI2CWriteByte(0x00);
SoftI2CStop();
Delay(1);

SoftI2CStart();
SoftI2CWriteByte(0x90);
SoftI2CWriteByte(0x01);
SoftI2CStop();

Delay(1);

SoftI2CStart();
SoftI2CWriteByte(0x91);
MSB = SoftI2CReadByte(TRUE);
LSB = SoftI2CReadByte(TRUE);
SoftI2CStop();

i = (MSB + LSB) >> 4;

Yours truly,
Sylvain Bissonnette
www.microsyl.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems like last line should deal with MSB and LSB differently. Like i=(unsigned int)MSB*256 + LSB; or something similar?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

finaly I found the problem, I use the library made by
Software I2C Library for AVR Devices.

Copyright 2008-2012
eXtreme Electronics, India
www.eXtremeElectronics.co.in

and in the routine uint8_t SoftI2CReadByte(uint8_t ack)
there is a mistake you must had one line

uint8_t SoftI2CReadByte(uint8_t ack)
{
uint8_t data=0x00;
uint8_t i;

for(i=0;i<8;i++)
{

SOFT_I2C_SCL_LOW;
H_DEL;
SOFT_I2C_SCL_HIGH;
H_DEL;

while((SCLPIN & (1<<SCL))==0);

if(SDAPIN &(1<<SDA))
data|=(0x80>>i);

}

SOFT_I2C_SCL_LOW;
Q_DEL; //Soft_I2C_Put_Ack

if(ack)
{
SOFT_I2C_SDA_LOW;
}
else
{
SOFT_I2C_SDA_HIGH;
}
H_DEL;

SOFT_I2C_SCL_HIGH;
H_DEL;

SOFT_I2C_SCL_LOW;
H_DEL;

SOFT_I2C_SDA_HIGH;
return data;

}

Yours truly,
Sylvain Bissonnette
www.microsyl.com