2021-02-03 11:18 AM
I have been using the IIS3DWB evaluation board alongside TIs CC1352P2 uC to bring up software ahead of the actual hardware arriving. The SPI bus speed is 8MHz in mode 3.
The IIS3DWB is configured only sample accelerometer data on 3 axis and to store the values in the FIFO. The FIFO is configured to be in continuous mode with a FIFO watermark threshold configured to raise an interrupt when the threshold is exceeded.
Below is an outline of how I have configure the IIS3DWB:-
/* We need to allow 10ms for the STIIS3DWB to come up */
HAL_TIME_sleep( STIIS3DWB_STARTUP_TIME );
/* Reset the software - this resets control registers to default condition */
stiis3dwb_software_reset();
/* Ensure Accelerometer is in powerdown mode*/
stiis3dwb_write_config_mode ( STIIS3DWB_POWER_DOWN );
/* Enable 3-axis mode */
stiis3dwb_write_active_axis( STIIS3DWB_3_AXIS );
/* Set the acceleration resolution */
stiis3dwb_write_xl_resolution( STIIS3DWB_XL_RES_2G );
/* Set the FIFO mode to Continuous Mode */
stiis3dwb_write_fifo_mode( STIIS3DWB_CONTINUOUS );
/* Set FIFO Watermark that will trigger interrupt */
stiis3dwb_write_fifo_watermark_threshold( STIIS3DWB_FIFO_WATERMARK );
/* Set the accelerometer batch rate for the FIFO */
stiis3dwb_write_fifo_batch_data_rate( STIIS3DWB_FIFO_XL_26667_HZ );
/* Enable Block Data Update */
stiis3dwb_write_block_data_update();
/* Configure FIFO interrupts i.e. */
stiis3dwb_write_register ( STIIS3DWB_INT1_CTRL, STIIS3DWB_INT1_CTRL_INT1_FIFO_TH );
/* Enable Accelerometer */
stiis3dwb_write_config_mode ( STIIS3DWB_NORMAL );
The uC will then read back the number of FIFO words to read and then using SPI read the FIFO words. Note I have configured the BDU in CTRL3_C and read back the number of FIFO words by reading FIFO_STATUS1 first and then FIFO_STATUS2.
As you can see from below the FIFO threshold is triggering the interrupt correctly and the uC is reading the contents of the FIFO quickly enough to avoid any sampling lose.
MISO - 0
MOSI - 1
CLK - 2
CS - 3
INT1 - 4
If I allow the IIS3WB to sample for approximately 8+ mins, I’ve observed that the interrupt stops triggering and hence the uC no longer reads back any entries in the FIFO. Sometimes this test could run until 50+ mins before stopping.
On closer inspection, I noticed that the last interrupt seems to have a ‘blip’ and at that point the data being read back from the FIFO is 0s. Previously the interrupt would have remained high for longer.
Further debugging shows that SPI communications are functioning correctly afterwards . I can read back the contents of the WHO_AM_I register perfectly but when I read back the contents of the control registers, the values are all 0’s. It is possible to write to those registers again.
Has anyone observed anything like this previously or can suggest further steps for investigation. From the outside it almost looks as if a reset of the IIS3DWB’ config has occurred.
I noticed something similar raised https://community.st.com/s/question/0D53W0000090yOPSAY/iis3dwb-int1-int2-stoppingstuck-at-high-after-several-watermark-events but there doesn't seem to have been any response to the questions posed.
Thanks in advance
John
Solved! Go to Solution.
2022-09-08 01:17 AM
Hello
I see exactly the same
I explain that in https://community.st.com/s/question/0D53W00001au2FVSAY/iis3dwb-in-fifo-mode-does-not-work
It is not solved for me ...