This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS7142: ADS7142

Part Number: ADS7142

Hi,

I'm using the ADS7142 and am putting it in Manual Mode and want to read both channels. My initialization code is below:

int Init_ADS7142(MODULE_NUMBER mod)
{
// Select the port that the module is attached to.

PCA9547_SelectPort((unsigned char)mod);

ADS7142_WriteReg(mod,REG_ABORT_SEQUENCE,1);
//ADS7142_WriteReg(mod,REG_OFFSET_CAL,1);

ADS7142_WriteReg(mod,REG_CH_INPUT_CFG,0x03); // Two channel, single ended
ADS7142_WriteReg(mod,REG_OPMODE_SEL,4); // Manual Mode with Auto Sequencing
ADS7142_WriteReg(mod,REG_AUTO_SEQUENCE,3); // Read Both Registers

return(1);
}

I pretty much got the code from your source code.  I'm able to look at the data on a scope and validate that I send the correct data to the chip which would be the I2C Address (ADDR is floating so the address is "0011000x" and the device ACK's so I know it is correct), then the Single Register Write command (0x08), then the register value and then the data.  I have gone through and validated all the data is correct.

To read, the data, I send the I2C address with the read bit set and then clock the data out as per the datasheet states below:

I first set the START bit in register 0x1E and then read the data.

When I read the data, it looks like this:

The first octet is the I2C address with the Read bit set and the ADS7142 ACKs.  Then I clock out the next 8 bits which should be the most significant byte of channel 1 but the device does NOT ack back and then all subsequent bits are 1's which I don't think is correct because my inputs are both around 0V so I would expect maybe the 2 least significant bits be toggling around but most at 0.

I am bit banging this bus and driving the outputs low when I want SCL or SDA to be low and tri-stating so my pullups will pull the signals high when I want them to be 1's.  I have other devices on the bus that are working fine so I'm confident that the bus is functional but I do note that you may stretch the clock so I don't know if that is an issue. The bus is running about 152Khz.

I'm pretty sure I have everything initialized correctly I just can't figure out why I'm not reading the correct data.

Thanks!

John

  • Hello,

    Bit banging is not ideal, there are numerous issues that can occur when trying to communicate by bit banging. 

    Are you monitoring the BUSY pin? This pin should go high when converting, if this pin is not changing state, then we know it is not being correctly told to being converting. Clock stretching is also a possibility, the ADC will hold the clock signal until it is ready to communicate with the host, at this point it will release the clock signal. 

    Regards

    Cynthia

  • Hi Cynthia,

    Yes, I'm monitoring the Busy signal.  When I power up my system, it is low. It is low all throughout the initialization.  It goes high right at the end of the I2C cycle when I set  the start bit to a 1 in register 0x1E.  After that, I never see it go low again.

    John

  • Hello John, apologies for the absence, have you been able to move forward with this?