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

TWI Issue With Peripheral Sensors

I'm building some code off of the twi_master_using_app_twi example which is available in the SDK (v11.0.0).

The two peripherals I'm working on are an accelerometer (LIS3DH) and gyroscope (L3GD20H).

I'm able to read and confirm the WHOAMI registers of both sensors, but that's about it. When I check the status register, both return all zeros. When I read the XYZ data off of each sensor the output data is just a constant value for all directions of motion with no sensitivity to movement.

I've been stuck at this point for a couple days now and I feel like I must be missing something simple/obvious. Any tips on where to start?

Parents
  • SInce you are able to read out the WHOAMI registers it seems safe to assume that you have configured the TWI and connected everything correctly. So my bet would be that there are some "start up" registers in your sensors that need to be set. For example, some sensors I have worked with start up in sleep mode by default, and one have to manually start the sampling of sensor data. Maybe this was handled in the background in the Arduino drivers?

Reply
  • SInce you are able to read out the WHOAMI registers it seems safe to assume that you have configured the TWI and connected everything correctly. So my bet would be that there are some "start up" registers in your sensors that need to be set. For example, some sensors I have worked with start up in sleep mode by default, and one have to manually start the sampling of sensor data. Maybe this was handled in the background in the Arduino drivers?

Children
No Data
Related