FIFO usage and tap interrupt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-16 9:10 AM
Hi, I am working with LSM6DS3TR sensor and need some advice on FIFO usage. I have followed sample code from the ST's GitHub page but still have some questions. I am using continuous-to-FIFO mode and tap interrupt.
- I see samples on my screen when interrupt happens. Do these samples come from FIFO or from the present state of the IMU?
- If coming from FIFO, I am unable to get more than 350 patterns. In code below, it prints 300 samples. How do I get more patterns?
- The FIFO can memorise 4096 samples of 16 bits each. Does this mean I can have 4096 samples of data or 4096/16 samples?
//Set FIFO watermark to a multiple of a pattern
pattern_len = 6;
pattern_numbers = 300;
lsm6ds3tr_c_fifo_watermark_set(&lsm6ds3, pattern_numbers*pattern_len);
lsm6ds3tr_c_fifo_stop_on_wtm_set(&lsm6ds3, PROPERTY_ENABLE);
//Set FIFO mode to Stream-to-FIFO mode
lsm6ds3tr_c_fifo_mode_set(&lsm6ds3, LSM6DS3TR_C_STREAM_TO_FIFO_MODE);
//Enable FIFO watermark interrupt generation on INT1 pin
lsm6ds3tr_c_pin_int1_route_get(&lsm6ds3, &int_1_reg);
int_1_reg.int1_single_tap = PROPERTY_ENABLE;
lsm6ds3tr_c_pin_int1_route_set(&lsm6ds3, int_1_reg);
//Set FIFO sensor decimator
lsm6ds3tr_c_fifo_xl_batch_set(&lsm6ds3, LSM6DS3TR_C_FIFO_XL_NO_DEC);
lsm6ds3tr_c_fifo_gy_batch_set(&lsm6ds3, LSM6DS3TR_C_FIFO_GY_NO_DEC);
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-17 6:16 AM
Hi @ASoni.2​ , let me try to answer to some of your questions:
- In the continuous-to-FIFO mode, the FIFO buffer starts operating in Continuous mode and switches to FIFO mode when an event condition occurs (see p.99 of AN4650)
- Let me check if I well understood... if you set "300" as FIFO watermark, and your device is running, when the tap interrupt is risen the FIFO starts collecting up to 300 samples, and when this watermark is reached the FIFO itself rises an interrupt and it stops filling. If you want to acquire more samples, you have to increase the FIFO watermark value.
- The LSM6DS3 FIFO is 8 kbyte sized (p.1 of AN4650), meaning you can store up to 4096 samples of 16 bits each.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-17 6:16 AM
Hi @ASoni.2​ , let me try to answer to some of your questions:
- In the continuous-to-FIFO mode, the FIFO buffer starts operating in Continuous mode and switches to FIFO mode when an event condition occurs (see p.99 of AN4650)
- Let me check if I well understood... if you set "300" as FIFO watermark, and your device is running, when the tap interrupt is risen the FIFO starts collecting up to 300 samples, and when this watermark is reached the FIFO itself rises an interrupt and it stops filling. If you want to acquire more samples, you have to increase the FIFO watermark value.
- The LSM6DS3 FIFO is 8 kbyte sized (p.1 of AN4650), meaning you can store up to 4096 samples of 16 bits each.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-20 6:38 AM
Hi @Eleon BORLINI​ , Thank you for your answer. I have managed to get maximum number of samples supported by FIFO.
Kind regards
