i2cdump shows all as xx xx xx with adxl345 sensor board.

1,091 views
Skip to first unread message

Mrigendra Chaubey

unread,
Oct 6, 2017, 3:46:39 PM10/6/17
to BeagleBoard

Hi all,

I have a bbb, and I have interfaced an adxl345 on p9_19 and p9_20.
on i2cdetect -r 2 I can see the chip address 0x53 as SDO is grounded.

When I try to do 

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

and 

 i2cdump -y 1 0x53

I see all entries as 

root@beaglebone:~# i2cdump -y 1 0x53
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX

I am directly connecting 3.3v(p9_3) to  3v3 of adxl and gnd(p9_1) to gnd of adxl. Also I am direclty connecting to p9_19 to scl and p9_20 to sda directly.
I do not have oscilloscope so I can't check much
 what is wrong here?



Robert Nelson

unread,
Oct 6, 2017, 4:08:05 PM10/6/17
to Beagle Board, Mrigendra Chaubey
On Fri, Oct 6, 2017 at 2:46 PM, Mrigendra Chaubey <mrigendr...@gmail.com> wrote:

Hi all,

I have a bbb, and I have interfaced an adxl345 on p9_19 and p9_20.
on i2cdetect -r 2 I can see the chip address 0x53 as SDO is grounded.

When I try to do 

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

and 

 i2cdump -y 1 0x53


Except you just read it on bus 2?

i2cdump -y 2 0x53

 

I see all entries as 

root@beaglebone:~# i2cdump -y 1 0x53
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX

I am directly connecting 3.3v(p9_3) to  3v3 of adxl and gnd(p9_1) to gnd of adxl. Also I am direclty connecting to p9_19 to scl and p9_20 to sda directly.
I do not have oscilloscope so I can't check much
 what is wrong here?

There's a mainline driver for the ADXl345:



Just echo:

echo adxl345_i2c 0x53 > /sys/bus/i2c/devices/i2c-1/new_device
or
echo adxl345_i2c 0x53 > /sys/bus/i2c/devices/i2c-2/new_device

Regards,

--
Robert Nelson
https://rcn-ee.com/

Mrigendra Chaubey

unread,
Oct 6, 2017, 4:29:30 PM10/6/17
to BeagleBoard
I was at mistake
I did echo adxl345_i2c 0x53 > /sys/bus/i2c/devices/i2c-2/new_device

in dmesg

[  110.747301] i2c i2c-2: new_device: Instantiated device adxl345_i2c at 0x53
[  308.580190] i2c i2c-2: Failed to register i2c client adxl345_i2c at 0x53 (-16) 

 

danie...@gmail.com

unread,
Oct 8, 2017, 7:24:27 PM10/8/17
to BeagleBoard
Reply all
Reply to author
Forward
0 new messages