10 years, 11 months ago.

i2c Frequency() function limit

Hi People,

I have a pair of simple code for two ST Nucleo boards I have, one is set as I2C Master-transmitter and the other one is Slave-receiver. the codes are working fine together, and I have verified results both on oscilloscope and also on PC terminal with default I2C frequency (100KHz).

I tried to increase the I2C Frequency to 300KHz, with frequency() function. The problem arises when I try to use "i2c.frequency(300000)" for master, and "slave.frequency(300000)" for slave. Even with default 100000 value, the communication won't establish.

Am I missing something with this function?

I appreciate any help with this.

2 Answers

10 years, 11 months ago.

Hi,

Might want to check you are using pull-up resistors on the SCLK and SDA lines (typically 2K Ohms approx. for 400KHz)

Regards

Martin

(BTW I checked my i2c and could change the frequency from 10KHz to 400KHz (Yes I did try 10KHz!) with 200 and 300 options all worked fine posted program list tagged under i2c and eeprom)

10 years, 11 months ago.

Hi,

The available I2C frequencies on STM devices are : 100kHz, 400kHz and 1MHz (on some devices).

So try with 400 kHz instead of 300 kHz.

Regards.

If we give different frequencies other than the standard frequencies like what u mentioned, the chip is not executing the program, rather it just hangs

posted by BALAGANESH ARASIAH 13 Jun 2017