We have an ESP32-S3 design using ADS7142 device from TI controlled by I2C bus.
To write or read data to or from ADS7142 registers you do not only have to transmit device address and register address but
also an Opcode for read/block read/write etc. which is an 8bit byte.
Simply spoken to read a register you need to do this sequence (acks not shown)
1. Access
Start - device address - Write bit - Wr/Rd OpCode - Register address - Stop
2. Access
Start - device address - Read bit - register data from device - Stop
We do not see a way how this can be implemented with I2C API of esp-idf (latest mater 5.2.x)
Does anybody have an idea how this can be implemented?
How to Rd/Wr data from I2C device with extra opcode (ADS7142)
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: How to Rd/Wr data from I2C device with extra opcode (ADS7142)
Hi Microcontroller,
thanx for your proposal - unfortunately this does not work due to the issue in I2C API, see
https://github.com/espressif/esp-idf/issues/13400
With i2c_master_transmit the buffer data are sent in a row so if you have e.g. 24bit in the buffer
all 24 bits are sent without interrupting.
The ADS71242 however expects that after every byte (8bits) I2C host waits for ACK
thanx for your proposal - unfortunately this does not work due to the issue in I2C API, see
https://github.com/espressif/esp-idf/issues/13400
With i2c_master_transmit the buffer data are sent in a row so if you have e.g. 24bit in the buffer
all 24 bits are sent without interrupting.
The ADS71242 however expects that after every byte (8bits) I2C host waits for ACK
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: How to Rd/Wr data from I2C device with extra opcode (ADS7142)
That issue seems to not be relevant to your case.TeeVee wrote: ↑Fri May 10, 2024 11:03 amunfortunately this does not work due to the issue in I2C API, see
https://github.com/espressif/esp-idf/issues/13400
Sounds like standard I2C. Haven't checked the ADS's datasheet, but I guess it's also I2C standard compliant, so both the ESP and the ADS should be able to properly handle standard I2C ACKs without you doing anything.With i2c_master_transmit the buffer data are sent in a row so if you have e.g. 24bit in the buffer
all 24 bits are sent without interrupting.
The ADS71242 however expects that after every byte (8bits) I2C host waits for ACK
Who is online
Users browsing this forum: benrank, Majestic-12 [Bot], romboidale, sohaib.q and 92 guests