This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

reading external sensor using i2c

hi...

i want to read the  external accelerometer sensor using i2c in nRF52832 ..how to do ?

Parents
  • Hi, 

    You could start from the TWI Sensor Example which use the I2C interface by communicating with the thermometer (LM75).

    -Amanda H. 

  • i have connected externally  the accelerometer sensor in scl and sda pin of nrf52832 . but i am not getting any data 

  • What is the accelerometer sensor, based example project and SDK you are using?

    What did you modify the project?

    Have you tried debugging your application? Could you provide the debug log?

    -Amanda H. 

  • i didn't modify anything . i am using MMA7760 accelerometer sensor ,15.2 v

  • Hi, 

    If you google MMA7760, the first result points to the datasheet: https://www.nxp.com/docs/en/data-sheet/MMA7660FC.pdf

    In the MODES OF OPERATION section in that datasheet the interfaces are described (I2C).

    If you download the SDK we have the TWI Sensor Example to show how to use TWI. However, it does not suit for MMA7760. 

    And the TWI driver is documented here: TWI 

    You could modify the TWI_SENSOR example to configure the twi driver correctly to match the sensor and transmitting the correct commands. I would say that it does not matter what example you use as the template as long as the configuration for twi drvier does suit the sensor. And unfortunately, we do not have any example for that accelerometer. 

    -Amanda H.

  • Hi... Amanda

    i tried .. but i am getting constantly 0 as a value . see the code 

Reply
  • Hi... Amanda

    i tried .. but i am getting constantly 0 as a value . see the code 

Children
No Data