I2cdump works, but not i2cget

I am trying to use BMP180 on top of i2c on a Raspberry Pi.

I found a chip. I can take i2cdump, but I can not read one byte.

Any idea what I'm doing wrong?

Printout:

$ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 abcdef 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- 77 $ sudo i2cdump -y 1 0x77 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 abcdef 0123456789abcdef 00: XX XX XX XX XX 00 XX 00 XX XX XX 00 XX XX 00 XX XXXXX.X.XXX.XX.X 10: 00 XX XX 00 XX XX 00 XX 00 XX 00 XX 00 XX 00 XX .XX.XX.XXXXX 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 80: a5 94 48 09 2a 27 78 7b 8a 7e 1f 05 fb b0 c7 c2 ??H?*'x{?~?????? 90: 82 18 63 d2 4c b8 19 73 00 28 80 00 d1 f6 09 b2 ??c?L??s.(?.???? a0: a5 94 48 09 2a 27 78 7b 8a 7e 1f 05 fb b0 c7 c2 ??H?*'x{?~?????? b0: 82 18 63 d2 4c b8 19 73 00 28 80 00 d1 f6 09 b2 ??c?L??s.(?.???? c0: 00 00 bc 33 00 00 00 00 00 00 00 10 00 00 00 03 ..?3.......?...? d0: 55 02 06 00 00 00 00 00 00 00 00 00 00 00 00 00 U??............. e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ f0: 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 ......?......... $ sudo i2cget -y 1 0x77 0xd0 Error: Read failed 
+5
source share
1 answer

First you need to set up control registers. For BME280 (I believe that it is the same for BME180), you need to write:

 $ i2cset -y 1 0x76 0xF2 0x01 $ i2cset -y 1 0x76 0xF4 0x25 $ i2cdump -y -r 0xF7-0xFE 1 0x76 c 0 1 2 3 4 5 6 7 8 9 abcdef 0123456789abcdef f0: 6d 72 00 86 68 00 59 bb mr.?hY? 

The first 2 entries set the oversampling x1 for all channels. The second additionally triggers one conversion.

+1
source

Source: https://habr.com/ru/post/1214264/


All Articles