Open caternuson opened 3 years ago
Not sure if related, but the power on defaults for the control registers does not match datasheet:
Quick manual reading of control registers after initial power up (the | 0x80
is how you specify multi-byte read):
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board
>>> i2c = board.I2C()
>>> i2c.try_lock()
True
>>> buffer = bytearray(5)
>>> i2c.writeto_then_readfrom(0x18, bytes([0x20 | 0x80]), buffer)
>>> print("0b{:08b}".format(buffer[0]))
0b00111111
>>> print("0b{:08b}".format(buffer[1]))
0b00000000
>>> print("0b{:08b}".format(buffer[2]))
0b00000000
>>> print("0b{:08b}".format(buffer[3]))
0b00110000
>>> print("0b{:08b}".format(buffer[4]))
0b00000000
>>>
The CTRL_REG1
and CTRL_REG4
don't agree.
Just to make sure it's not a quirk of multi-byte reads, can get same thing reading individually, ex:
>>> i2c.writeto_then_readfrom(0x18, bytes([0x23]), buffer, in_end=1)
>>> print("0b{:08b}".format(buffer[0]))
0b00110000
>>>
Not seeing any errata or updated datasheet on ST's site: https://www.st.com/en/mems-and-sensors/h3lis331dl.html#documentation
Hello caternuson,
I am having the same issues on Rpi and arduino, did you find out what caused the problem?
Best regards jozuz
Adding forum link for ref: https://forums.adafruit.com/viewtopic.php?f=60&t=192698
Re this thread: https://forums.adafruit.com/viewtopic.php?f=60&t=176800
Recreated using Pi Zero W: