cancel
Showing results for 
Search instead for 
Did you mean: 

Change hold time in I2C on Nucleo F401RE

guidoglorioso01
Associate II

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 );
  }
}
1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

3 REPLIES 3
TDK
Guru

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".

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

 

 

@TDK well, i give up and put the resistors ( the signal was good edges enough), and all start working. They went 6 hours of lost time ‌‌. 
So never trust in internal pull up. 
Thanks