cancel
Showing results for 
Search instead for 
Did you mean: 

how to get LSM6DSOX simple I2C pass through working

MEnna.2
Associate II

I have a MMC5603NJ (i2c addr 0x30) connected to SDx and SCx on LSM6DSOX with INT2 pin grounded. I can see with logic analyzer I2C transactions on BOTH the Slave and Master interface, but every time I try to access a register in MMC5603 on Master bus I get a NAK, as if the LSM6DSOX is not letting the SDx pin go to float maybe? seems like it "should just work" i see all the slave I2c transactions mirrored on the master SDx and SCx pins exactly, just cannot access the other device on the master side of the LSM. I must be doing sometime (simple) wrong? Also .. how do you configure the "Modes" 1,2, on this chip? is it only by vitrue of the wiring ? thanks much

5 REPLIES 5
MEnna.2
Associate II

BTW this is a trace of the tansaction, the top two lines are the LSM6 MASTER SDx and SCx, the bottom two the LSM6 slave I2C from the MCU, SDA/SCL. note the NAK, seems like the LSM6 is not letting the SDx line go float? also this MMC5603NJ works perfectly if its connected directly to the MCU I2C. I write a '1' to the LSM6DSOX_FUNC_CFG_ACCESS bit to get to the Sensor Hub registers, then enable MASTER_ON and PASS_THROUGH_MODE=1 in the MASTER_CONFIG register. thats it.

OHHH... geez should have thought of this before... the NAK is coming from the LSM6 slave interface because it does not realize its in 'pass through' mode and should just pass it on !! I proved this by just unplugging the downstream device. I have followed the procedure in AN5272 7.3.1 Pass-through feature enable, step by step. Is there something else that the LSM6 needs to know in order to pass thru the I2C operations??? Stumped.. need help asap thanks

Eleon BORLINI
ST Employee

Hi @Community member​ ,

You have to configure the device in Mode 2, if you want to use the I2C interface master for external sensor connections, and you have to configure the LSM6DSOX accordingly. I suggest you to have a look to the C examples on Github, showing how to connect and configure a magnetometer and a pressure sensor to the LSM6DSOX --> lsm6dsox_sh_lis2mdl.c, lsm6dsox_sh_fifo_lps22hh.c.

-Eleon

Eleon,

Thank you for your response. Looking at these examples and others I had looked at , seems they are *not* using "Pass_Through_Mode" as described in AN5272. That is the app note I was following as I want to use "Pass_Through_Mode". These examples use the sensor hub to read/write 1 register.

When you say "You have to configure the device in Mode 2" what *exactly* does this mean? I have the INT2 connected to GND and SDx and SCx connected to the slave downstream device.

I expected that setting the MASTER_CONFIG "PASS_THROUGH_MODE" bit = 1 was supposed to as datasheet and app note says "The main I2C bus (from MCU) is short circuited with the auxiliary in order to access registers in external devices" See AN5272 pp65-66.

Is this not correct? Does Pass Thru mode not work as described? I have not found any github examples using this.

Thanks again !

Mark

@Eleon BORLINI​ 

sure would be great to get an asnwer to these 2 simple questions:

1) what *exactly* do you have to do to "configure the device in Mode 2" ? do you write some registers? I don't see them... do you just GND the INT2 pin and hook up SDx and SCx? I did that already.

2) Does "PASS_THROUGH_MODE" work as AN5272 says or not ? If so, can you show me some working code as I have followed the procedure to no avail.

Thanks

Mark

JOSul.1
Associate

@Eleon BORLINI​ I would also appreciate clarification on the initialisation of pass-through mode as we are also unable to read or write to sensors through the auxillary I2C lines shorted through enabling this mode. I've followed the application note as @Community member​ has done with no success. The github examples you have shared do not use pass-through and so are of little use - I have been unable to find github examples that use pass-through beyond initialisation commands that appear identical to my own.

Any assistance would be appreciated.

Best Wishes,

Jack