Code: Select all
samtal wrote: ↑Sat Aug 04, 2018 5:45 amI am unable to modify the Raspberry Pi 3 I2C baud rate. I have tried many options, but while it looks like the baud rate is being changed, in monitoring the actual signals it always remains at 100kHz.
I use the native raspberry Pi3 SMBus commands that seem to work ok, except that there is no rate setting.
tlfong01 wrote: ↑Sat Aug 04, 2018 7:29 amI have tried many options, but while it looks like the baud rate is being changed, in monitoring the actual signals it always remains at 100kHz.
Last year I found my slow device did not work with 100kHz, so I changed to 50kHz, and the slow device worked. This shows that I could indeed change the speed, modifying /boot config.txt
Errata - I mixed up I2C with SPI. I only found changing SPI speed to 50kHz OK. My apologies
How do you monitor the actual signals? Do you use a scope?
This is a little late, but I do not belive that the I2C protocol lets you set just any baudrate. Actually, to be technical, SMBus only allows 100K and 400K (K=1000) baudrate, and that may be it. SMBus is an Intel protocol, vs Phillip / NXP's I2C ) is more restrictive than the revamped I2C which support much faster rates. ...
samtal wrote: ↑Sat Aug 04, 2018 10:05 amhave it in my config.txt file (with reboot), but it does not affect my Raspberry 3B actual I2C rate as can be shown on my scope or logic analyzer. It keeps running at 100kHz.
From all the replies I received so far, it looks really as a dead end, ...
From what I learned (briefly), the I2C reg can only accept I^2 dividers (OK with me if I can make it 100/2=50Khz),
Code: Select all
bcm2835I2 ClockDivider Specifies the divider used to generate the I2C clock from the system clock. Clock divided is based on nominal base clock rate of 250MHz BCM2835_I2C_CLOCK_DIVIDER_2500 2500 = 10us = 100 kHz BCM2835_I2C_CLOCK_DIVIDER_626 622 = 2.504us = 399.3610 kHz BCM2835_I2C_CLOCK_DIVIDER_150 150 = 60ns = 1.666 MHz (default at reset) BCM2835_I2C_CLOCK_DIVIDER_148 148 = 59ns = 1.689 MHz