I2C0 Not working

96boards

#1

Hi,
I am interfacing Adafruit BNO055 orientation sensor (Which works on I2C 5v/3.3v logic level.) with dragon board 410c .Interfacing with dragon board as I2C0 (Pin 15 I2C0_SCL,Pin 17 I2C0_SDA on LE expansion connector)I used the level shifter SparkFun TXB0104.
I added the device in device tree (in apq8016-sbc.dtsi --> i2c@78b6000).
But I am not able to read/write to device i am getting error as ::
“i2c-msm-v2 78b6000.i2c: ARB_LOST: msgs(n:2 cur:0 tx) bc(rx:1 tx:1) mode:FIFO slv_addr:0x28 MSTR_STS:0x0c1321d0 OPER:0x00000010.”

what could be the issue?


#2

Hi. The message “misconfigured GPIO or slave pulling bus lines(s) low” seems troublesome. I didn’t look into your details but level shifting is tricky to not unintentionally get a resistor to ground/power when it’s supposed to be floating (or possibly the other way around).


#3

Which build/os are your running ?

This is an Arbitration Lost error, typically happening when there are several masters on the bus, but a possible reason could be that a slave pull down SDA when it should not. I suggest you to double check your connection, level shifter (GND, VccB > VccA…). Do you get same error with i2c1 ?


#4

I am using APQ8016_410C_LA.BR.1.2.7-01010-8x16.0_6.0.1_Marsh_Mallo_P2 .

Checked connections its correct.

I didn’t check with I2C1 ,I shall check it


#5

Hi @Loic,
I checked with the I2C1(On LE expansion connector Pin 19 I2C1_SCL,Pin 21 I2C1_SDA) But No luck Now i am getting Error: NACK: slave not responding, ensure its powered


#6

Do you really need to run Android or is it by default ? I’ve just tested I2C on DB410C + Debian and it seems to work (at least i2cdetect find my wii-nunchuck i2c device).


#7

Yes I need to run android ,its not by default. I downloaded the android source and adding Bno055 sensor support for android.


#8

Hi @Krishna_Katore

This is a classic case of trying to debug hardware connections without using the right tool. If you have access to an oscilloscope you can quickly probe the I2C clock and data lines as well as the power supplies. You can also make basic checks with a voltmeter although the voltmeter will not be able to debug more complex errors.

Connect the boards with the following directions:

  • Connect BOTH grounds on the Sparkfun TXB0104 board the 410c Ground pins (pins 1 and 2 on the low speed connector)
  • Connect VCCA on the TXB0104 to 1.8V from the 410c (pin 35 on the low speed connector)
  • Connect I2C0-SCL (Low speed connector pin 15) to A1 on the TXB0104
  • Connect I2C0-SDA (Low speed connector pin 17) to A2 on the TXB0104
  • Connect GND from the pin 39 of the low speed connector to the GND pin of the BNO055 board
  • Connect +5V from the 410c (Low Speed connector pin 37) to the VIN pin on the BNO055 board
  • Connect the 5V from the BNO055 board to VCCB of the TBB0104 board
  • Connect SCL form the BNO055 board to B1 of the TXB0104 board
  • Connect SDA from the BNO055 board to B2 of the TXB055 board

WARNING! keep the wires between boards as short as possible! The TXB0104 has a tendency to burst into oscillation when long wires are connected.

Note: The signals in and out of the BNO055 board are 5V signals, and the board needs 5V to run. Fortunately the 410c can provide 5V.

Once you have everything connected correctly and powered up, check the following with a voltmeter:(depending on the accuracy of your voltmeter all readings should be within +/-10% of the nominal voltages)

  • Connect the GND lead (usually black) to pin 40 on the 410c Low speed connector. Leave this connected for all measurements.
  • measure the VCCA on the TXB0104, it should be 1.8V
  • measure VIN at the BNO055 board it should be 5V
  • measure VCCB at the TXB0104, it should be 5V

At this point you have everything powered up correctly, the last thing you can check with a voltmeter is that all of the signals are in the correct idle states.

  • measure A1 and A2 at the TXB0104, they should both be 1.8V.
  • measure B1 and B2 at the TXB0104, they should both be 5V. If you measure 2.5V here, then the TXB0104 is oscillating because your wires are too long.

The very last thing you can check is that the signals can go low. To do this you need to change software (device tree) so that the I2C0 pins are GPIOs and drive each GPIO low, while the GPIO is driven low it should be around 0.3V at the TXB0102 A1 and A2 pins. Ensure that you program the maximum possible drive strength on the pads, since the Adafruit boards typically have very strong pull-up resistors on the I2C lines. If you have a higher voltage (say 1.0V) then you may need to remove the pull-up resistors from the BNO055 board (R8 and R9), they are not necessary since the TXB0104 has built-in pull-up resistors.

Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.


#9

Hi @ljking, I check the all connections and voltages its as expected only .Only thing i need to check the last point “The very last thing you can check is that the signals can go low” .I shall check it .
Here are my connections:


RTC DS1307 on Dragonboard 410c
#10

Please forgive my interfering but do you really mean TXB010x here? As I understood things TXB010x is not suitable for I2C level shifting at all. Also I remember you mentioning short wires and oscillation previously w.r.t. the audio mezz board which uses TXS010x parts.

.


#11

Hi @ljking ,
I checked the last thing [quote=“ljking, post:8, topic:3611”]
The very last thing you can check is that the signals can go low. To do this you need to change software (device tree) so that the I2C0 pins are GPIOs and drive each GPIO low, while the GPIO is driven low it should be around 0.3V at the TXB0102 A1 and A2 pins. Ensure that you program the maximum possible drive strength on the pads, since the Adafruit boards typically have very strong pull-up resistors on the I2C lines. If you have a higher voltage (say 1.0V) then you may need to remove the pull-up resistors from the BNO055 board (R8 and R9), they are not necessary since the TXB0104 has built-in pull-up resistors.
[/quote]

the voltages(by making I2C0 SDA and then SCL line low from sysfs “/sys/class/gpio” by mounting debugfs) at TXB0102 A1,A2 was around >2.1 ,then i removed the Pull-up resistors R8 and R9 from BNO055 board, but no luck getting error as "BUS ERROR:noisy bus/unexpected start/stop ".


#12

Hi @ljking , I tried with PCA9306 level shifter from sparkfun, now bno055 with i2c0 is working .
also tried with Sensor Mezzanine board ,it worked fine.