IEEERobotics / bot

Robot code for 2014.
BSD 2-Clause "Simplified" License
17 stars 10 forks source link

BBB I2C Clock Speed #26

Closed R00ney closed 10 years ago

R00ney commented 10 years ago

I need to find out, by Google or by someone with more knowledge, if it is possible to change the clock speed upon which device I2C 2 runs. Or if it really is stuck permanently at 100KHz. If it can change, how do we change it, and what can we change it too?

If it is stuck at 100KHz, we will most likely need a device other than the MSP430 G2332 chip, because I can only make it's I2C clock run at 2^n power divisors of 1,8,12,16 MHz. The closest this gives to 100HKz is 125KHz, which does not apparently work. (though I will test again in the near future to make sure, as I'm constantly doubting my tests right now).

Again, if anyone with more BBB experience can find related info, I would appreciate it.

PaladinEng commented 10 years ago

What clock speed do you need it to be?

R00ney commented 10 years ago

If we could change it to 16MHz, that would be awesome. However any 2^n power divisors of 1,8,12,16 MHz would work just as well.

PaladinEng commented 10 years ago

From: https://groups.google.com/forum/#!topic/beagleboard/Q1pDr1lT7Gk

from u-boot you set bootargs for the kernel. There you can use this argument: i2c_bus=3,16000 This means: i2c bus 3, freq=1600kHz

Haven't had time to verify that you can set the speed to that particular freq, but this might help you find it.

R00ney commented 10 years ago

Um, where can I find out more about the u-boot thing? I'm afraid I don't know what that refers to. Thanks! Neal

napratin commented 10 years ago

The u-boot arguments for BBB are specified in a file named uEnv.txt at the root of the boot partition (/boot or /boot/uboot/). This partition may not be mounted by default.

Also, looking at kernel logs from our BBB, I see these messages related to i2c:

[    0.154681] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    0.156295] input: tps65217_pwr_but as /devices/ocp.2/44e0b000.i2c/i2c-0/0-0024/input/input0
[    0.168207] omap_i2c 44e0b000.i2c: unable to select pin group
[    0.168978] omap_i2c 4819c000.i2c: bus 1 rev0.11 at 100 kHz
[    0.171509] omap_i2c 4819c000.i2c: unable to select pin group
[    2.316312] i2c /dev entries driver
napratin commented 10 years ago

Just a note: So far we've been unable to change the I2C bus speed on the bone with the above edits.

dfarrell07 commented 10 years ago

We're solving this via a side-channel, correct? So this issue is done and can be closed?

R00ney commented 10 years ago

Not yet, I would say. There are future alternatives that will try to implement the I2C with BBB, I believe. Neal

dfarrell07 commented 10 years ago

We've solved this by not using I2C, and we're planning on upgrading to a solution that doesn't use ACDs but moves back to I2C, but with chips that use a standard speed.