Current location - Recipe Complete Network - Dietary recipes - I2C bus speed-up
I2C bus speed-up
We are making a product recently. In this product, we use the organic light-emitting diode screen as the display device. The OLED screen is connected with raspberry pie based on I2C bus. During the operation, I feel that the screen speed is very slow and the overall display effect is not smooth. Later, it was found that raspberry pie can improve the display speed of OLED screen by increasing the transmission speed of I2C bus.

First, enable the I2C interface on the raspi-config management tool.

See the figure below for specific options:

Remember to restart when you are finished.

Then, enter the command line to edit the config.txt file, which is the most important part:

Locate the line containing "dtparam=i2c_arm=on" and add "i2c _ arm _ baud = 400000" after it. This line indicates that the transmission rate of I2C is set to 40kbit/s.

Save and exit, and you're done after restarting.

In addition, according to the description of BCM2835 ARM peripheral (page 28), it is mentioned that Raspberry Pie has a "fast mode" drive, and baudrate can take a value between 100000~400000. 100000 is the default value, so I can set it to 400000 to enable I2C express mode for Raspberry Pie.