2023-12-02 10:16 AM
Hey folks,
I've fabricated a little PCB to glue an LSM9DS1 to an ESP32-S3. As far as I can see, the ESP32 is sending the correct signals but the LSM9DS1 isn't returning anything useful. Here's what I get when I try to read 0x0F, the WHOAMI register, from both the accel/gyro and magnetometer. Signals are CS, SDI, SPC, SDO, in that order:
As you can see, SDI shows 0x8F and SDO shows 0xFF while the master is sending but 0x00 while the master is receiving.
This is really weird to me because it tells me that the SPI communication is working but the slave device is responding with 0x00.
What on earth might cause this? As far as I can tell, the signals match the datasheet specification pretty much exactly. At the moment my leading theory is that the ICs I got are counterfeit. The PCB was ordered assembled through JLCPCB, which uses LCSC. If it means anything, the IC is marked 2108 9S1 23BOE:
Here's my schematic as well:
2023-12-05 06:23 AM
Hi @Filling5681 ,
Welcome to ST Community!
To better understand your problem, can you share also the acquisition with the oscilloscope also with the MAG CS?
In addition, how did you set the SPI Mode (0,1,2,3)?
Thanks
2023-12-05 06:54 AM
Inspect the PCB too. There might be some faults in it.
2023-12-05 07:28 AM
@Federica Bossi Unfortunately I only have a 4-channel oscilloscope so I can't show you everything at once. I can tell you that both CS pins seem to work fine when working indepdendently. They're definitely not connected to the same pins or anything like that.
SPI is set to mode 3 but I've tried other modes as well, no luck.
@liaifat85I've checked the PCB and the solder joints and tried another PCB. No luck there.
I've also tried multiple different MCUs. All show the same problems. I tried various different SPI speeds, SPI modes, different register addresses, adding delays in different places. Always the same result.