I2C delayed ACKs and delay between functions
Posted: Mon Mar 11, 2024 11:07 pm
Hi,
I'm having some trouble getting my I2C communication to work correctly. This project was ported over from an Arduino project, because of the higher communication rates of the ESP32 WROOM32. But I do know the project is working on an Arduino Uno R3.
It seems like the ACK to a command, be it a read/write/start, only gets 'checked' at the start of the next command. This causes large delays between commands, as well as some write commands not being 'saved' in the slave at the right moment.
This can be clearly seen in the first image, with the top waveform being SLC, the bottom being SDA, (function shown is i2c_master_write_read_device, also used i2c_master_write_to_device with the same issue). There is a large gap between the start and the first ACK, and this happens for nearly all operations (I think it doesn't happen for the address write, since those bytes get sent by the same command). The next image also shows this, the ACK does not seem to be checked until the next block. Does anyone know why this might happen? Or how to fix this? I have searched through the forums but couldn't find someone with the same issue, this problem did not appear on the Arduino.
Thanks in advance,
Ward
I'm having some trouble getting my I2C communication to work correctly. This project was ported over from an Arduino project, because of the higher communication rates of the ESP32 WROOM32. But I do know the project is working on an Arduino Uno R3.
It seems like the ACK to a command, be it a read/write/start, only gets 'checked' at the start of the next command. This causes large delays between commands, as well as some write commands not being 'saved' in the slave at the right moment.
This can be clearly seen in the first image, with the top waveform being SLC, the bottom being SDA, (function shown is i2c_master_write_read_device, also used i2c_master_write_to_device with the same issue). There is a large gap between the start and the first ACK, and this happens for nearly all operations (I think it doesn't happen for the address write, since those bytes get sent by the same command). The next image also shows this, the ACK does not seem to be checked until the next block. Does anyone know why this might happen? Or how to fix this? I have searched through the forums but couldn't find someone with the same issue, this problem did not appear on the Arduino.
Thanks in advance,
Ward