Skip to main content
Associate II
October 13, 2023
Solved

Change hold time in I2C on Nucleo F401RE

Hello, i am dealing with an i2c issue.

I am trying to trasnmit from my NucleoF401RE (as master) to an ESP32 (as slave). I cant make to ESP32 respond the device address. 

I take some measures off the SDA and SCL signals

guidoglorioso01_0-1697221946794.png

I realized that SDA has cero hold time and i am not quite sure if it is okey.

I make also some measure but now using my ESP32 as master and those are the signals:

guidoglorioso01_1-1697222038002.png

i am not quite sure but i think this is the problem beacuse de ESP32 does not send the acknowledge.

Is there a way to put some hold time to my nucleo F401RE ? 

Right now i am using the I2C in polling mode. I add my config and code:

guidoglorioso01_2-1697222186104.png

 
int main(void){  
MX_I2C1_Init();
  /* USER CODE BEGIN 2 */
 
Buffer_tx[0] = 0x15;
Buffer_tx[1] = 0xF5;
  while (1)
  {
ret = HAL_I2C_Master_Transmit(&hi2c1, SLAVE_ADDR, Buffer_tx, 2,HAL_MAX_DELAY );
  }
}
    This topic has been closed for replies.
    TDK
    TDKBest answer
    October 13, 2023

    You have very slow edges. Likely the external pullup is insufficient or not present at all and you're relying on internal pullups instead.

    You can lower the clock speed to get better looking edges.

    Note that HAL expects left-aligned slave addresses. So 2x the 7-bit address.

    "If you feel a post has answered your question, please click ""Accept as Solution""."

    3 replies

    TDK
    TDKBest answer
    October 13, 2023

    You have very slow edges. Likely the external pullup is insufficient or not present at all and you're relying on internal pullups instead.

    You can lower the clock speed to get better looking edges.

    Note that HAL expects left-aligned slave addresses. So 2x the 7-bit address.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Associate II
    October 13, 2023

    Thanks for your comment @TDK , the edges get better but the problem is the same. I doble check the adress shift and its okey. You know if is posible to change hold time? i really think that is the problem. 

    guidoglorioso01_0-1697230159128.png