2020-04-29 09:48 PM
hi st:
I am using lis2dh, driven by spi. Initially set to fifo mode, 25hz. When the power is turned on for the first time, I can read that there is data in the fifo, and the data are normal. When I reset the mcu and initialize the sensor again, the data cannot be read later. I have to power on lis2dh before it can work properly. So how to reset lis2dh, I have tried to set it to power dowm mode and then set it to normal mode, and it still behaves like this.
ps (vddio and vdd connect to vdd)
thanks!
Solved! Go to Solution.
2020-04-30 04:33 AM
Hi @Zwf.1 , after you reset the MCU and re-initialize the sensor did you tried to read the WHO_AM_I (0Fh) register, to check if the issue is on the data output stage , on the FIFO art or on the sensor as a whole? If the issue is with the FIFO, I suggest you to switch to Bypass mode before shutting down the device, to reset the FIFO. If you are working in normal mode, the datasheet reports also this recommendation, in p. 37:
By design, when the device from high-resolution configuration (HR) is set to power-down mode (PD), it is recommended to read register REFERENCE (26h) for a complete reset of the filtering block before switching to normal/high-performance mode again for proper device functionality.
Regards
2020-04-30 04:33 AM
Hi @Zwf.1 , after you reset the MCU and re-initialize the sensor did you tried to read the WHO_AM_I (0Fh) register, to check if the issue is on the data output stage , on the FIFO art or on the sensor as a whole? If the issue is with the FIFO, I suggest you to switch to Bypass mode before shutting down the device, to reset the FIFO. If you are working in normal mode, the datasheet reports also this recommendation, in p. 37:
By design, when the device from high-resolution configuration (HR) is set to power-down mode (PD), it is recommended to read register REFERENCE (26h) for a complete reset of the filtering block before switching to normal/high-performance mode again for proper device functionality.
Regards
2020-05-05 06:09 PM
I reset the fifo, and now it can work. thanks