6 years, 7 months ago.

changing i2c frequency

I've been trying to figure out how to change the i2c frequency of the MAX32630FTHR.

In the _IMU_Hello_World example, I'm seeing that the bus initially clocks in at around 100khz, but once the sensors are sampling in the main loop, it seems to be operating at 400khz. Where are these rates set at? (Can't seem to find it in the main code or bmp180 library files...). Setting i2c.frequency() doesn't seem to make any difference.

I've also tried the I2C_Scanner application, attempting to call i2c.frequency() with different values. It doesn't seem to make any difference. Aside, it looks like I cannot scan from address 0x08 (must start the scanning loop at address 0x09), otherwise the I2C lines seem to go low and do nothing. I'm using 2k pullups to 3.3V on P3_5 and P3_4, the SCL and SDA lines.

Based on this project it looks like a slower i2c frequency of 10k was used at one point, but if I try to run this code, I see 400k signals on the scope as well.

Any pointers to how I can investigate this further is much appreciated!

Question relating to:

MAX32630 Rapid Development Platform

Are you using the max32630fthr library and specifying the correct voltage for the I2C pins?

There are some additional examples on an applications wiki page: https://os.mbed.com/teams/MaximIntegrated/wiki/MAX32630FTHR-APPS

One of the examples demonstrates a library for the BMP180: https://os.mbed.com/teams/MaximIntegrated/code/MAX32630FTHR_IMU_Hello_World/

Please remember that the I2C bus connected to the BMP180 has 1.8V pullups and these pins must be configured for 1.8V operation. You can select the voltage you want to use for the other pins with the max32630fthr library. If you use this library, it will set SDA2 and SCL2 to 1.8V.

posted by Greg Steiert 04 Oct 2017

2 Answers

6 years, 6 months ago.

Not really an answer, as I don't have the board. But the speed is set here (indeed, default at 400KHz). The i2c_frequency call seems to be implemented correctly, so it'd be interesting to see if a different speed is used if you change the 400KHz initialize to something else.

If so, might be a HAL bug, can you file it at https://github.com/armmbed/mbed-os ?