[SOLVED] i2cdetect doesn't detect anything

Started by Shakipu, July 06, 2014, 06:39:33 PM

Previous topic - Next topic

Shakipu

Hello everyone,

I got a few sensors I would like to plug to my A20 (without NAND, Rev.E) and they are working using I2C. These sensors are the BMP180 and the TSL2561 from Adafruit. I tried them with an Arduino and it was perfectly functional.

Then I tried to plug them into the I2C bus of the UEXT2 connector. I tried i2cdetect to detect them but nothing is being detected. I've checked almost 10 times my cabling and tried it on the Arduino another time but i2cdetect won't find it. I also tried to put my Arduino as a I2C slave and plug it directly to my A20 but again, nothing is detected.

I tried to put it on the UEXT1 connector or on the GPIO2 connector. Still nothing. The best I can get is what this guy get : https://www.olimex.com/forum/index.php?topic=2866.0. And this seems more a bug than anything else.

I'm using kernel 3.4.67+ with Debian distributed from Olimex. Is there a module I need to load ? Something I need to patch ?

Thanks in advance. I've been struggling my whole week-end on this...

bubi

Hi Shakipu,

I don't understand if with arduino the TSL2561 still works.
By default arduino use internal pull-up resistors on SDA and SCL signal (see Wire.c), but they are on 5V, while the TSL2561 runs at 3.3V. So you could damage the sensor.
Same thing if you want to use arduino as a slave for the olinuxino a20.

From the post you linked I can see that are used both i2c-0 and i2c-1, but the i2c channel used in the UEXT connectors are i2c-1 and i2c-2. i2c-0 is used to connect the AXP209 power management unit, and the "UU" means that the device with address 34 has been registered by the kernel

Try to disable arduino internal plug-in and see if it works (I'm using arduino as a i2c slave to manage the motor shield)

Regards   

dave-at-axon

Do you gave pullup resistors on the external boards you are trying to use?

Disable them as the A20 has pullups on the board already. I've seen this give lots of failed devices before.

Shakipu

QuoteBy default arduino use internal pull-up resistors on SDA and SCL signal (see Wire.c), but they are on 5V, while the TSL2561 runs at 3.3V. So you could damage the sensor.
Same thing if you want to use arduino as a slave for the olinuxino a20.

The Adafruit documentation says :
QuoteYou may be wondering, how is it OK to connect a 3.3V chip like the TSL2561 to 5.0V data pins like the Arduino? Isn't that bad? Well, in this specific case its OK. I2c uses pullup lines to the 3.3V power pin, so the data is actually being sent at 3.3V. As long as all the sensors/device on the i2c bus are running on 3.3V power, we're fine.

So I should be fine, I've got no problems reading these sensors with an Arduino.

QuoteDo you gave pullup resistors on the external boards you are trying to use?

Disable them as the A20 has pullups on the board already. I've seen this give lots of failed devices before.

Disabling them means that I should remove them from the board. I've got no control over these pullups resistors. However, I tried to use the I2C on the GPIO2 (TWI0) because they don't have any pullups resistors. The result stays the same.

QuoteFrom the post you linked I can see that are used both i2c-0 and i2c-1, but the i2c channel used in the UEXT connectors are i2c-1 and i2c-2. i2c-0 is used to connect the AXP209 power management unit, and the "UU" means that the device with address 34 has been registered by the kernel

Thanks for the explanation about the i2c-0. I already tried to poll the i2c-2 but nothing is detected. When I do i2cdetect -l, I can see the three I2C buses (0, 1 and 2).

dave-at-axon

Quote from: Shakipu on July 07, 2014, 08:48:46 AM
Disabling them means that I should remove them from the board. I've got no control over these pullups resistors. However, I tried to use the I2C on the GPIO2 (TWI0) because they don't have any pullups resistors. The result stays the same.

TWI0 does have pullups via R75 and R76. They are next to the SDA and SCL at the AXP209

If you do have them on your board, I would suggest to somehow remove them. I have seen issues with failed I2C when there are more than 1 pullups on the boards.

Lastly, can you show us how you have it wired to the A20?

adinu

You most likely already checked this but just in case:

Do you have I2C enabled in the sys_config.fex file (twi0_used, twi1_used and twi2_used)?

Shakipu

#6
This is the TWI part of my script.bin :
Quote[twi0_para]
twi0_used = 1
twi0_scl = port:PB00<2><default><default><default>
twi0_sda = port:PB01<2><default><default><default>

[twi1_para]
twi1_used = 1
twi1_scl = port:PB18<2><default><default><default>
twi1_sda = port:PB19<2><default><default><default>

[twi2_para]
twi2_used = 1
twi2_scl = port:PB20<2><default><default><default>
twi2_sda = port:PB21<2><default><default><default>

Quote
TWI0 does have pullups via R75 and R76. They are next to the SDA and SCL at the AXP209
You are true, I've double checked the schematic.
I was talking about the pullups resistors on the breakout boards for the sensors. I surely don't want to play too much with my A20. Plus, it's easier to remove the pullups resistors on the sensors than on the A20.
I will make you a diagram as soon as possible. For now, I'm a little bit busy but I will try to make something clean for you.

EDIT: Here is a quick drawing made with Inkscape. Keep in mind that I use the BMP180, not the BMP085 (it's almost the same) and I'm not using the Flora version of the light sensor (the classic version doesn't exist in Fritzing) but the wiring is the same. These sensors works with the Arduino Uno.


Shakipu

The MOD-BMP085 from Olimex uses pullups too.

dave-at-axon

If you have left the pullups on both boards, I suggest you remove them if you can. I am pretty certain that is why it's not working. My board here had pullups on it for a RTC and I could not get it to work until I removed them from the board. As the A20 has them already, it now works fine.

bubi

Hi Shakipu,

do you have rev1 or rev2 of the BMP180 breakout? rev2 has an internal level-shifter that could not work properly with same voltage on HV and LV side.

Did you tryed to use only the light sensor? just to know if it works on the A20

Shakipu

Bupi, I have the rev2 of the BMP180. If you are true, this could be something more difficult to fix. I tried to plug only the tsl2561 but I got nothing on my i2c buses. Sometimes, I get this on the i2c-1 :
Quote0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
But my sensor is at the address 0x39...

QuoteI suggest you remove them if you can. I am pretty certain that is why it's not working.
Yay... I may try this if nothing else works. Where does your RTC come from ?

dave-at-axon

Quote from: Shakipu on July 08, 2014, 07:40:26 PM
Where does your RTC come from ?

I use the Maxim DS1338 and I included it on my carrier board that I use with the A20. The driver is using the DS1307 and I rebuilt the Linux kernel to use it.


I have another idea for your little boards. If you don't need to use them with an Arduino and plan only to use with the A20, remove all of the level shifting parts and pullups etc and then link the input to the output via the solder pads left behind. Then everything is simple and there is no pullups or level shifting to give your bus any issues and as you as powering from 3.3V all is well.

martinayotte

On which bus did you connect your i2c devices ?
because the i2c-1 bus is the one where the AXP chip is connect.
With my A20 board, I've some i2c devices on UEXT1 and they are seen on i2c-2.

bubi

Shakipu, your result of i2cdetect on i2c-1 is normal. The addresses that you see are referred to the EEPROM T24C16BN-SH, and that's good because means that the i2c port works  ;)

In my case I have a DS1307 and an arduino connected via a level-shifter at the same bus and all work properly.

Try, as suggested by dave-at-axon, to remove all pull-up resistors from the breakout (you can restore them later if needed)

Regards

Shakipu

Ok, I was just wondering why these addresses were showing some times and some times not.