ciudadverde
Posts: 20
Joined: Mon Sep 03, 2012 11:46 am

I2c speed

Sat Oct 13, 2012 3:14 pm

Hello all,
I want to connect many i2c port expanders from microchip to control 10 matrix 8x8 led.These matrix will be multiplexed. I dont know the max. speed of the bus i2c in the pi .Normally speeds are 100khz ,400khz and 1mhz. To calculate the multiplexed speed i need which will bw the max throuput in the outport of the pi.
Thanks

Frank B
Posts: 61
Joined: Fri Sep 14, 2012 8:02 pm
Location: Germany

Re: I2c speed

Wed Oct 17, 2012 8:05 pm

Hi,

default speed is 100kHz.

ciudadverde
Posts: 20
Joined: Mon Sep 03, 2012 11:46 am

Re: I2c speed

Fri Oct 19, 2012 4:20 pm

Thanks, but what is the max practical speed?

ciudadverde
Posts: 20
Joined: Mon Sep 03, 2012 11:46 am

Re: I2c speed

Sun Oct 21, 2012 2:50 pm

I test a microchip expand port (mcp2307) and the max speed is 400khz. The datasheet said : 100 , 400 and 1700khz. At 400khz a pin toggle is 500hz with a bash script and with python 10000hz, with C i don't tested.My proyect will be a multiplexed led array (10 x 8x8 array)

Frank B
Posts: 61
Joined: Fri Sep 14, 2012 8:02 pm
Location: Germany

Re: I2c speed

Sun Oct 21, 2012 4:47 pm

ciudadverde wrote:Thanks, but what is the max practical speed?
Hi,
depends on your slaves and your layout.
Max for pi is 150 MHz. In theory. I don't think that this is of any pratical use.
I tested with 1MHz and it worked ok. I have no faster slaves.
Frank.

sgo
Posts: 2
Joined: Sat Oct 13, 2012 11:03 am

Re: I2c speed

Thu Oct 25, 2012 5:20 pm

The maximum achievable speed will be limited by the rise time achievable with the implemented pull-ups on the SDA/SCL line.
To increase speed you have to add pull-up of lower ohm value.

The second limit will be the slaves I2C hardware limitation.

There are instances of 3.4MHz I2C. But it has to be tested :)

jz01aolcom
Posts: 3
Joined: Thu Oct 15, 2015 1:46 pm

Re: I2c speed

Thu Jan 14, 2016 9:45 pm

I have a Raspberry Pi Compute Module that I was hoping to get running at Fastmode+ or 1MHz.

I set up the I2C for both port0 and port1. I have an O-scope connected to both (reference is on GND pin). So there is no buffer or pull-up resistor here, just a straight connection to the scope. I set the baud rate on port0 to be 400KHz and the baud rate on port1 to be 1 MHz. When I run "i2cdetect -y 0" in the terminal, I see a nice 400 KHz signal for a second or so. Great! When I run "i2cdetect -y 1" in the terminal, I see another nice 400 KHz signal for a second or so. Not Great :x

I do realize that I will need pull-up resistors, buffers, and I2C slaves but I figured a straight connection to clock would be faster.
Can you explain to me why I get 400 KHz on port1? How does a pull-up resistor make the clock faster? Isn't this based on RC time constant which only increases with R?

Thanks for any help on this!

FYI:
I set the baudrate in /boot/config.txt with
dtparam=i2c0_baudrate=400000
dtparam=i2c1_baudrate=1000000
After saving the txt file, I reboot. I know this changes the rate because I can change it from 100KHz to 400KHz.

Also, I used "i2cdetect" because I don't know of a better way of testing the I2C signal yet... :(

Return to “Advanced users”