jam1
Posts: 47
Joined: Tue Oct 21, 2014 5:51 pm

BCM2708_I2C speed setting?

Sun Mar 29, 2015 10:48 am

Hello,

Here is my question. I want to change the bus speed for the i2c lines. Whatever I tried has failed so far. From the dmesg listing I can see that the speed is set-up at around 6 seconds into the boot process. Where is the script that is setting this baudrate?

this is from dmesg
.
.
[ 5.583682] bcm2708_i2c 20804000.i2c: BSC1 Controller at 0x20804000 (irq 79) (baudrate 100000)
.
.
.
I did try
sudo modprobe i2c_bcm2708 baudrate=32000


and adding options into /etc/modprobe.d/custom.conf

options i2c_bcm2708 baudrate=32000

did not work.

thank you

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: BCM2708_I2C speed setting?

Sun Mar 29, 2015 11:35 am

You are probably using device tree.

Device tree is great.

In /boot/config.txt add the line

dtparam=i2c_arm_baudrate=xxx

where xxx is the baudrate you want, e.g. 32000

Remove options i2c_bcm2708 baudrate=32000 as it will likely conflict.

jam1
Posts: 47
Joined: Tue Oct 21, 2014 5:51 pm

Re: BCM2708_I2C speed setting?

Sun Mar 29, 2015 12:27 pm

Thank you, it works great but it does not answer my question: where is it setup in the boot process if I don't add this parameter in the config.txt file? Is it hard coded in the kernel?

Secondly, it does not help the problem I am having. I am trying to control a PCA9685 with I2C and I cannot set the control byte register to the value I want. I can set all the other registers. I thought that by decreasing the clock it would do the job but not in this case. ( I did browse all the forums posts on the subject)
I know that the PCA9685 works because I can run it from an ATMEGA328.

Return to “Interfacing (DSI, CSI, I2C, etc.)”