Can you please help clarify below issue for a customer?
In setting functions from a uC to communicate through the I2C interface (ONET8501P and TLK1101E), they will each acknowledge their own slave address, but then will hold down SDA line for the following 8 bits. The SDA line is then released for the 9th or acknowledge bit sending a NAK. I am using the same function to shift out both the slave address byte and the register address byte where the problem occurs. I have measured the clock L-H periods, rise-fall times- data and stop time setups etc.. and everything looks well within specs. The SCL is running at 70KHz.
I don't understand the question.
Is this still an issue?
Alex helpfully clarified for me that the read transaction requres a "dummy write", also known as a repeated start condition, which is not uncommon for directing register reads from slaves. This information is nowhere in the 3-year-old datasheet so I am posting it here on E2E to save someone else the two days it took me to hunt this down.
If you try to read following the datasheet, which indicates
"The protocol for a data transmission is as follows:1. START command2. 7 bit slave address (0001000) followed by an eighth bit which is the data direction bit (R/W). A zero indicatesa WRITE and a 1 indicates a READ.3. 8 bit register address4. 8 bit register data word5. STOP command"
you will succeed (with appropriate ACKs) for writes. You can observe success by e.g. seeing the current consumption jump when your device is enabled. Data is MSB-first, like I2C should be.
If your code is like mine (was at first), reads will ACK the address but NAK the register data word. Your handler should return with error due to the NAK. An example of a failed read from slave 0x10 (left-justified) address 0x02 is here. It appears the slave is returning 0x00 and then NAKing the transaction, but after thinking about it I guess it may just be that the TWI state machine clears its transmit holding register at the end of a transaction, and the new transaction is NAKed, but the TWI still shifts out the THR data causing SDA to be pulled low.
The fix is to add the repeated start: first write the register you want to read, get ACK for slave address and ACK for register data word, then issue repeated start command (SDA goes low while SCL is high), then read one data byte, getting another ACK for slave address (plus read bit). You, the master, should/must NAK the read transaction to complete the bus cycle.
Pictorially, this is:
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.