2023-01-04 01:39 PM
Hi,
I am interfacing to a TI device that requires a 100us delay between each I2C byte and I can't think of any way that doesn't involve "hacking", i.e. using timer delays, interrupts, etc. Is there a more elegant way to do it using the ST I2C implementation? Using CubeIDE on a STM32H750 device.
Regards
Goran
2023-01-04 01:46 PM
An docs or paper on this part and issues?
Perhaps clock at 10 KHz or less, create some lag on servicing interrupts/callbacks?
2023-01-04 06:40 PM
Weird slave chipset. Nack on polling is one usual way to tell the host that the slave needs more time. Some sensirion parts had similar limitation which do not comply with the standard, and provide a pre cooked sw driver of gpio bitbang with special sw delays. No need speed when need to wait...
2023-01-04 07:27 PM
STM32H750 RM0433 says that its I2C supports clock stretching. Is this what you're looking for?
2023-01-08 12:03 PM
The device is a TI MCT8316A motor driver. The major impression of this device it that it is "incomplete" (to be nice about it), for example, it uses the I2C General Call address 0x00 as device ID (geeez...). The 100us delay requirement is a "silicon bug that will be fixed in the next chip revision", i.e. the current device is apparently to be considered a Beta version.
2023-01-08 12:05 PM
Well, AFAIK clock stretching must be initiated by the slave device and it does not. I get a feeling they have bit-banged the I2C implementation in the device with all the weird requirements.
2023-01-08 12:09 PM
https://www.ti.com/product/MCT8316A
The data sheet does not contain all the quirks of this device, only the "100us" requirement, the rest you will have to search/find on the TI support forum. Actually, 10kHz is the suggested alternative to 100us delay by TI when I asked about it, my problem right now is that after doing the recommend HW updates I can't even get an ACK response from the chip, the bus hangs.
2023-01-08 03:16 PM
For I2C protocol 10 kB/s translates to exactly 100 kbit/s bus speed. Just run the I2C bus at 100 kbit/s mode or slightly slower and you are fine.
2023-01-10 06:50 AM
Well, this device doesn't mind 100kbit/s, it "only" requires a 100us delay between each byte which is hard to do. What TI recommends to not have to do this delay is running at 10kbits/s, i.e.1kBytes/s.
2023-01-10 05:35 PM
Make an interrupt base state machine which walk alternatively the timer 100us delay interrupt and the i2c data transfer. You need to dynamically turn on/off each interrupt enable. Both vectors go to the state machine having same interrupt level.