2020-03-31 12:30 AM
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
Solved! Go to Solution.
2020-04-20 11:38 PM
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.
2020-03-31 01:08 AM
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
2020-03-31 07:11 PM
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
2020-04-01 12:54 AM
But you gets sometimes the correct WHO_AM_I, don't you? Regards
2020-04-20 11:38 PM
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.
2022-02-03 11:54 AM
all read are zero for me (CS pull down when boot)