i2c bus frequency

Started by Mouchon, August 26, 2013, 05:02:11 PM

Previous topic - Next topic

Mouchon

Hi Can some one tell me what's the i2c bus frequency
on the board and if there is a way to change it at runtime ?


XFer

I somehow recall it's fixed at 400 KHz, but I have to check it tonight at home.

Mouchon


Mouchon

looked with a digital analyser and it seem to be 100khz

XFer

Sorry, I just checked: I disabled i2c support from my latest kernel build so I don't know which is the default clock and if it's configurable.
Anyway there's no i2c section in the script.bin, which smells of fixed clock.

Fernando

HeHoPMaJIeH


Quote from: XFer on August 26, 2013, 08:51:50 PM
Sorry, I just checked: I disabled i2c support from my latest kernel build so I don't know which is the default clock and if it's configurable.
Anyway there's no i2c section in the script.bin, which smells of fixed clock.

Fernando
Hi,
i2c speed is configurable in kernel source , look at this file :
arch/arm/mach-sun7i/include/mach/i2c.h


#define TWI0_TRANSFER_SPEED     (200000)
#define TWI1_TRANSFER_SPEED     (200000)
#define TWI2_TRANSFER_SPEED     (400000)



~Best

XFer

So it's either 200 KHz or 400 KHz, selectable in the header file.

Thanks for the tip.

Fernando

Mouchon

Made different test and was able to configure frequency to 50khz on i2c-1
with stage/sunxi-3.4. I will try to adapt modules i2c-sunxi to make frequency change as module param or flex configuration entry.