0
\$\begingroup\$

I'm trying to communicate with an I²C device using an STM32F411 Nucleo board.

In standard mode (100 kHz) and fast mode (400 kHz) everything works fine. However, when I try to increase the speed above 400 kHz the connection stops.

I consulted the reference manual of the microcontroller (RM0383) which states as follows:

It supports the standard mode (Sm, up to 100 kHz) and Fm mode (Fm, up to 400 kHz). The I²C bus frequency can be increased up to 1 MHz. For more details about the complete solution, please contact your local ST sales representative.

I was quite surprised to read this since I have worked with microcontrollers produced by other companies, but in the same range of performance which could go up to 3.4 MHz (e.g. Kinetis K20 chips).

Long story short: Has anyone tried to increase the I²C frequency of a STM32 chip to above 400 kHz? And can explain to me what I have to do in order to get it to work?

I would be glad if I didn't have to contact a sales representative.

\$\endgroup\$
  • \$\begingroup\$ Going from 100k to 1M needs Cat5 cable and 30mA or 150R pullup to 5V at RX end. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 4 '17 at 12:20
  • \$\begingroup\$ What is the the second I2C device? What is the layout? Can you probe SCL and SDA? \$\endgroup\$ – Grebu Feb 4 '17 at 12:32
  • \$\begingroup\$ The slave device is an AS5048B. I added 4.7k pullup resistors to sda and scl. I just confirmed with my oscilloscope that scl is generated at 1Mhz, but I also realized that I probably have to use smaller pullups. \$\endgroup\$ – invenibo Feb 4 '17 at 13:56
  • \$\begingroup\$ I just tested it with 150Ohm instead of 4.7k on another board. Although the signal is much cleaner, I can't go above 650kHz. \$\endgroup\$ – invenibo Feb 4 '17 at 17:22
  • \$\begingroup\$ Did you read the signal by logic analyzer or oscilloscope? \$\endgroup\$ – MrBit Feb 11 '17 at 13:23
1
\$\begingroup\$

which could go up to 3.4 MHz (e.g. Kinetis K20 chips).

That's likely hip specific. I have never used any i2c devices that far but 500 to 600kbos is not uncommon, though technically not supported.

Pushing it over 1mhz could be tough. If I were to Doo it, I would make sure that more drive current. Is available (use lower value pull ups on the bus), watch out for stray capacitance / inductance (short and shielded wiring), and most important of them all, make sure that the devices support that kind of speed.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.