0
\$\begingroup\$

I plan to use an I2C interface in order to read the IMU (SparkFun 6 Degrees of Freedom IMU Digital Combo Board - ITG3200/ADXL345). Since the communication rate using I2C is 400kHz, I thought I should use the PRU in order to read the sensor as fast as possible, as it is 40 times faster in reading GPIOs compared to the Linux host kernel.

Now my question is how do I use I2C to read the sensor using PRU? If I2C implementation in PRU is complicated , then what are my other options?

Thanks

\$\endgroup\$
  • \$\begingroup\$ Doesn't the BBB have a built-in I2C interface? Have you tried that and determined that its throughput is insufficient? \$\endgroup\$ – uint128_t Jan 14 '16 at 1:17
  • \$\begingroup\$ what you gonna do, if you can read 40 times faster but you can't process the readed data. also 400khz is i2c full speed. \$\endgroup\$ – Marko Buršič Jan 14 '16 at 1:29
1
\$\begingroup\$

I would highly recommend simply using the beagle bone's I2C library's to do this. The library should allow you to set the I2C speed up to 400kHz, which is also known as "fast mode".

One of the things to consider when determining the I2C bus speed is how much data you actually need to move across it. If you are only going to be looking at two sensors like the ones you linked, chances are having a really high I2C bus speed will not make difference anyways. I can't seem to clearly find the data rate for the gyro but it appears that the accelerometer only produces new data at a rate of 3.2kHz. Using a multi-byte read for the device even at the normal 100kHz you will most likely be able to read data faster then the device can measure a new value. Running at higher speeds starts to show benefits when you have many devices communicating on the bus or devices that operate at a high speed themselves.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.