Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: m.naserddin on October 16, 2014, 05:51:15 PM

Poll
Question: how to configure the i2c frequence
Option 1: mm votes: 1
Option 2: mm votes: 0
Title: configuration of the I2C bus frequency
Post by: m.naserddin on October 16, 2014, 05:51:15 PM
Hello everybody,
i have the A20-OlinuXino-Micro and im using the i2c device with the standard frequency of 100 khz. I need  a higher frequency like 400 khz. can i configure that and how ?.

I would be thankfull for your help.

best reguards
Moataz
Title: Re: configuration of the I2C bus frequency
Post by: soenke on May 13, 2015, 11:51:17 PM
You have to modify the kernel source and compile your own kernel. Look at the tutorials to find out how to do this. For higher i2c-speed, you have to change:

arch/arm/plat-sunxi/include/plat/i2c.h line 196 ff

#define I2C2_TRANSFER_SPEED (400000) //400kHz

You can get up to 400kHz with the current hardware configuration.
If you add 1.8kOhm resistors in parallel to the current 2.2kOhm pullups you can go easily up to 1MHz and it still runs stable as rock.

You should not increase the i2c-clock connected to AXP or RTC clock above 400kHz.