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