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.
Hello there,
I'm trying to communicate with the ADS122C04 over I2C with a Raspberry Pi model 3.
My circuit is wired up as below, with 1k pull up resistors on the I2C lines, filter capacitors and AVDD at +5V rather than 3.3V.
The chip is visible on the expected address using i2cdetect, however I'm unable to write to it, getting: Error: Write failed.
The same error is given when attempting to write to a chip address which doesn't exist.
I am able to write to other I2C devices using the same bus and technique.
I've tried using two different Raspberry Pi's and two different ADS122C04 chips.
Any ideas or suggestions for why this might not be working?
Thanks in advance,
Matt
Hi Matt,
Welcome to the E2E forum! If either the RESET pin is low, or if one of the supplies is missing (both AVDD and DVDD must be at the nominal voltage) the device will not communicate. However, as the i2cdetect is finding the device, the ADS122C04 should be able to communicate.
Can you send me what you are attempting to do (write a register, read a register, etc.)? From the commands shown, you are attempting to write to the device (0x40) a command (0x00) that doesn't exist and this will give a NACK. The list of commands are on page 38 of the datasheet in Table 16. For example, if you want to write a register (0x40 command) with the contents 0xE0 to register 0, you would need to send to address 0x40 the command and data 0x40 0xE0. So the following command should work:
i2cset -y 1 0x40 0x40 0xE0
And to read the register contents:
i2cset -y 1 0x40 0x20
i2cget -y 1 0x40
I think the above will work for reading the register contents, but I don't have a way to verify the operation nor have I ever used these commands in a linux environment. I think you will find that these simple commands will be limiting. The write command/data should work for writing and reading registers, but as the communication is command based doing multi-byte reads may be more complicated, such as reading the data using the RDATA command as this requires reading three bytes.
Best regards,
Bob B