cancel
Showing results for 
Search instead for 
Did you mean: 

h3lis331dl ID problem

YLiu.34
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
YLiu.34
Associate II

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.

View solution in original post

5 REPLIES 5
Eleon BORLINI
ST Employee

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.34
Associate II

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

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

YLiu.34
Associate II

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.

CLi.11
Associate II

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