This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change I2C speed
#11
Hi scopiochang,

I measured the i2c-1 SCL (pin5).
it become 125kbps (8us / bit).

but I set the clock frequency 400k.

why??
is it max frequecy of i2c-1??

thanks for your support.

u26


Attached Files Thumbnail(s)
   
Reply
#12
(03-09-2018, 11:10 AM)u26 Wrote: Hi scopiochang,

I measured the i2c-1 SCL (pin5).
it become 125kbps (8us / bit).

but I set the clock frequency 400k.

why??
is it max frequecy of i2c-1??

thanks for your support.

u26

Hi u26
I think that it is 400k.
   
Reply
#13
Hi 1SeeSee1

oh... I really confused.

thank you for your advice.
Reply
#14
Hello Everyone,

sorry to dig a +1year old post but I'm facing the same problem of having the I2C buses (i2c-1 and i2c-4) limited @ 100khz ... or even less based on my oscilloscope measures : 86.2 khz exactly.


Actually I'm looking to connect a MPU9250 sensor which is an accelerometer/gyroscope/magnetometer + temperature sensor (2 devices in 1 ... or quite  Smile ).

Anyway, when running the "i2cdetect -y <X>" command (where <X> has to be replaced by the I2C bus needed), I can seem to see from time to time my 2 devices address IDs showing but but vanishing/disappearing ... and appearing again and then REPEAT !  Dodgy

So basically, I was pretty sure I was facing 1 possible problem out of 2 probabilites :
  • Voltage regulator on MPU9250 board which was not liking having +3.3v on its input and having to generate +3.3v at its output anyway : I managed to confirm that this was not a problem at all
  • I2C bus having some weird problems on the Tinker Board : definitely not, I tried another sensor which was not the same as my MPU9250 and it worked fine
  • I2C bus speed/clock/baudrate : DEFINITELY THE REASON WHY I'M HAVING PROBLEMS !
Actually, I pluged my oscilloscope on the "SCL" pin #28 (i2c-4) of the Tinker Board and found out the it was running @ less than 100khz as said earlier in this post.
So from here, I was "ok, then let's go and change that baudrate/clock/speed of that damn I2C" ... long story short, this seems to be a totaly mess/problem because there is no way in TinkerBoard to change that speed/clock easily.

I could find some information regarding the U-BOOT part which seems to embed a setting for "i2c fast mode", but I just don't know how to change it/apply it without recompiling everything which I find to be a total non-sense just to change 1 clock setting for I2C.
Quote:i2cfast - (PPC405GP|PPC405EP only)
  if set to 'y' configures Linux I2C driver for fast
  mode (400kHZ). This environment variable is used in
  initialization code. So, for changes to be effective
  it must be saved and board must be reset.

So if anyone knows a way to change that damn value easily, it would be really appreciated by myself, and surely other community people here, because there are well more I2C devices using 400khz (fast mode) than the standard 100khz.


Thanks


Attached Files Thumbnail(s)
   
Reply
#15
For run I2C 1 and 4 at 400 kHz, not tested.


Attached Files
.gz   I2C.tar.gz (Size: 772 bytes / Downloads: 7)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)