Cannot read multiple Bytes from LSM9DS0 via I2C #809
Replies: 2 comments
-
Posted at 2015-10-07 by DrAzzy Not all I2C devices automatically increment the address like that - take a look at the datasheet... Edit: Ahha! Here, pg 33, second paragraph:
And in sparkfun's code that's just what they do:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-07 by otbe Hi, after my post I re-read the docs to verify that the LSM9DS0 is capable of block reading. Yes it is, but I overlooked something. The MSB of the register to read must be 1 for auto incrementing the address. I will give this a try later and add another post. :) Thank you. Edit: hehe you were faster :D |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-10-07 by otbe
Hi everyone,
Im currently writing a module for Sparkfuns LSM9DS0 9DOF IMU. The IMU is properly wired and works as expected. After some configuration I try to read 6 Bytes from register OUT_X_L_A (0x28). My code looks like the following:
result is an Int8Array of size 6, but it contains 6 equal values. More specific: its the value from OUT_X_L_A and all other registers (OUT_X_L_A+1, OUT_X_L_A+n) won't be read. Something like [ 13, 13, 13, 13, 13, 13 ] instead of [ 13, 28, 90, 54, 77, 1 ].
I have seen many modules for other I2C devices that work this way, but if I do:
it works...Does anyone have an advice for me?
Best regards
otbe
EDIT: Im using a espruino pico with 1v80 firmware. The LSM9DS0 should be capable to send multiple bytes.
Beta Was this translation helpful? Give feedback.
All reactions