LSM303DLHC accelerometer/magnetometer

Discussion in 'Embedded Systems and Microcontrollers' started by Angelo_1460385217, Jun 1, 2016.

  1. Angelo_1460385217

    Thread Starter New Member

    Apr 11, 2016
    6
    0
    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
     
  2. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,789
    945
  3. Angelo_1460385217

    Thread Starter New Member

    Apr 11, 2016
    6
    0
    I think that it is not software problem
     
  4. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
    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.
     
  5. Angelo_1460385217

    Thread Starter New Member

    Apr 11, 2016
    6
    0
    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).
     
  6. dannyf

    Well-Known Member

    Sep 13, 2015
    1,811
    362
    Nothing unusual about that. Typically sure to the user failing to set up the device correctly. Read the datasheet.

    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.
     
  7. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,789
    945
    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....
     
Loading...