Skip to main content
Visitor II
March 31, 2020
Solved

h3lis331dl ID problem

  • March 31, 2020
  • 4 replies
  • 1985 views

Hi,

I have a board with h3lis331dl and asm330 on it. And the 2 sensors are weld on the same SPI wire. The MCU uses CS signal to select the sensor it wants to read. everything is going on well with asm330. But when I select h3lis331dl, the read out ID is correct at around first 3 times. But after that, the read out h3lis331dl ID becomes 0xff. I have no idea what's wrong here. Maybe some registers were set wrong? Did someone else suffer from this problem before? thanks.

lyc

    This topic has been closed for replies.
    Best answer by YLiu.34

    The problem is solved. h3lis331dl works good actually, but sometimes I cannot read the ID at the Debug mode. Maybe because of the time delay of the SPI communication.

    4 replies

    ST Employee
    March 31, 2020

    Hi @YLiu.34​ , it is strange you are able to read the h3lis331dl WHO_AM_I 3 times and then stop... you say both sensors are on the same SPI line, but they are connected to the same VDD and VDD_IO too? Are you correctly managing the CS polarities? I would suggest you to try to make the SPI communication safer by writing 1 into the I2C_disable bit of the CTRL4_C (13h) register of the asm330hh device, as described in the datasheet, p. 52. Regards

    YLiu.34Author
    Visitor II
    April 1, 2020

    Hi Eleon,

    Thank you for your reply. I tried the way as you said, but it doesn't work. I disabled the I2C of asm330lhh, the ID register of h3lis331dl continues to be 0xff. I suspect that maybe the sensor was broken.

    Best regards,

    lyc

    ST Employee
    April 1, 2020

    But you gets sometimes the correct WHO_AM_I, don't you? Regards

    YLiu.34AuthorAnswer
    Visitor II
    April 21, 2020

    The problem is solved. h3lis331dl works good actually, but sometimes I cannot read the ID at the Debug mode. Maybe because of the time delay of the SPI communication.

    Visitor II
    February 3, 2022

    0693W00000JOTfRQAX.pngall read are zero for me (CS pull down when boot)