LSM303DLHC accelerometer/magnetometer

Thread Starter

Angelo_1460385217

Joined Apr 11, 2016
7
Hi,

I have problem with write in CTRL register. When i write to accelerometer CTRL register everything is fine, but when i write to
magnetometer register, I always read default values from register. Anyone have the same problem?

Best regards,
Angelo
 

AlbertHall

Joined Jun 4, 2014
12,345
You have a controller running some software using an I2C bus to talk to a chip. The controller, I2C bus, power supply, etc, etc.(the hardware) must be working as you can correctly communicate with one part of the chip. As far as I can see, failure to talk to a different part of the same chip on the same I2C bus must be either the software or a faulty chip.
 

Thread Starter

Angelo_1460385217

Joined Apr 11, 2016
7
The problem is that I buy iNEMO-M1 system on chip with STM32 MCU and accelerometer, gyro and magnetometer sensor. Everything work properly except magnetometer. I can read from it, but not write to it. I think that it is not software problem, because the code is same for acc and mag (same chip, same I2C protocol, just different addressing).
 

dannyf

Joined Sep 13, 2015
2,197
. I can read from it, but not write to it.
Nothing unusual about that. Typically sure to the user failing to set up the device correctly. Read the datasheet.

think that it is not software problem,
Nobody can help you unless we can exam your thought process.

Try to see if you can find demo or vendoer code and see if it fails to work on your board.

Statistically speaking, newbies have a much better chance at finding bugs in commercially chips.
 

Kermit2

Joined Feb 5, 2010
4,162
Bad magnetometer then. As stated, the list of problem areas is short. If not software, then it must be hardware.

But YOU are the one with the parts in hand, we can only guess what might be wrong with YOUR project.

If not software, then it must be....
 
Top