Configuring I2C Interface


#1

Hi everyone,

I am having trouble operating an I2C sensor (OMRON D6T-8L-06) using Dragonboard 410c.

The sensor is connected to the 0th i2c-bus and has an added pair of 10kO pull-up resistors. Yet, running “i2cdetect -r 0” does not recognize the sensor (I tried varying the resistance value without any success). Additionally, the sensor seems not to have an associated built-in driver on Linux.

Assuming “i2cdetect” is only meant to acknowledge a proper i2c signal reception, we suspect two things:
1 - Default frequency sent by the board’s SCL pin might be too high for the sensor (>100kHz)
2 - Voltage levels might not be compatible; we noticed the sensor’s Vcc = 5V but idle voltage on both SDA & SCL pins of the board are at 1.8V. Is it normal?

Also, according to Qualcomm’s documentation of the Dragonboard, i2c sensor can be instantiated by modifying the Device tree source files. Is this necessary?

Thanks,

  • Ali

sensor spec sheet: https://www.omron.com/ecb/products/sensor/special/mems/pdf/AN-D6T-01EN_r2.pdf


#2

Hi @aidrici

Your primary problem is the voltage levels. The 96Boards Low speed connector is a 1.8V signal level connector (not just the 410c, but all CE compliant boards). you MUST provide level shifting between the Omron sensor, and the 410c board. There is no hope of any I2C communications until you add level shifters.

Fortunately we make it relatively easy to add level shifters. There are several Mezzanine boards available that have level shifters. As an added bonus, they also have the same 4-pin connectors that are on your sensor so all you have to do is plug the sensor in and all of your wiring is complete.

Two example mezzanine boards that will do what you want are: Audio Mezzanine and Sensors Mezzanine

You could also use this one, but the connectors are slightly different LinkSprite Kit

Once you have the correct electrical signal levels correct, i2cdetect should work.

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.


Connecting MCP3008 and Dragonboard
#3

I’ve also had success with the following level shifters with I2C on the Dragonboard:


#4

Thanks for the prompt reply @ljking and @barryb

I implemented the 1.8V/5V shifter as required and it does increase the SDA/SCL idle pin voltage of the board to 5V. However, i2cdetect still can’t detect any of my I2C sensors. Is the clock frequency too high? What’s the default value Dragonboards are using?


#5

If memory serves it isn’t possible to run i2cdetect on the Dragonboard 410c because the I2C controller does not support the SMBus “quick” feature that i2cdetect uses by default to probe for some devices.

For some devices you may be able to detect them using “i2cdetect -r” which forces all address to be probed by performing an SMBus read (and at the cost of only detecting devices that support reads).


#6

Thank you for the feedback, i2cdetect finally worked and the board was able to recognize the sensor!


#7

I ran i2cdetect on a board with a digital light sensor plugged in. here are the results:

linaro@linaro-alip:~$ sudo i2cdetect -r 0 0x20 0x3f
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x20-0x3f.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:
10:
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40:
50:
60:
70:

@danielt is correct, when you run i2cdetect without the -r option it doesn’t work:

linaro@linaro-alip:~$ sudo i2cdetect 0 0x20 0x3f
Error: Can't use SMBus Quick Write command on this bus

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.