LIS2DTW12 Read data continuous @ dataRate 25Hz, High-Resolution mode. ERROR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-13 11:11 PM
Device Reset after every data conversion
Value of all CTRL registers = Power On RESET value
device initialization steps
- power on
- delay 20 ms
- read device id
- reset device
- delay 5 ms
- write CTRL1 0x30
- write CTRL2 0x0C
- write CTRL6 0x60
Read samples in polling mode
Solved! Go to Solution.
- Labels:
-
Accelerometers
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-14 4:30 AM
Hi @Aishwarya ,
which kind of error are you facing? Communication (SPI or I2C) error or dataout error?
I'm afraid there is something wrong with the IF_ADD_INC bit configuration in register CTRL2 (21h)... can you please try with setting this bit to 0?
Btw, I suggest you to check if your configuration is OK on the LIS2DTW12 C-examples on Github, especially the lis2dtw12_read_data_polling.c file.
/* Enable Block Data Update */
lis2dtw12_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
/* Set full scale */
lis2dtw12_full_scale_set(&dev_ctx, LIS2DTW12_8g);
/* Configure filtering chain
*
* Accelerometer - filter path / bandwidth */
lis2dtw12_filter_path_set(&dev_ctx, LIS2DTW12_LPF_ON_OUT);
lis2dtw12_filter_bandwidth_set(&dev_ctx, LIS2DTW12_ODR_DIV_4);
/* Configure power mode */
//lis2dtw12_power_mode_set(&dev_ctx, LIS2DTW12_HIGH_PERFORMANCE);
lis2dtw12_power_mode_set(&dev_ctx, LIS2DTW12_CONT_LOW_PWR_LOW_NOISE_12bit);
/* Set Output Data Rate */
lis2dtw12_data_rate_set(&dev_ctx, LIS2DTW12_XL_ODR_25Hz);
-Eleon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-14 4:30 AM
Hi @Aishwarya ,
which kind of error are you facing? Communication (SPI or I2C) error or dataout error?
I'm afraid there is something wrong with the IF_ADD_INC bit configuration in register CTRL2 (21h)... can you please try with setting this bit to 0?
Btw, I suggest you to check if your configuration is OK on the LIS2DTW12 C-examples on Github, especially the lis2dtw12_read_data_polling.c file.
/* Enable Block Data Update */
lis2dtw12_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
/* Set full scale */
lis2dtw12_full_scale_set(&dev_ctx, LIS2DTW12_8g);
/* Configure filtering chain
*
* Accelerometer - filter path / bandwidth */
lis2dtw12_filter_path_set(&dev_ctx, LIS2DTW12_LPF_ON_OUT);
lis2dtw12_filter_bandwidth_set(&dev_ctx, LIS2DTW12_ODR_DIV_4);
/* Configure power mode */
//lis2dtw12_power_mode_set(&dev_ctx, LIS2DTW12_HIGH_PERFORMANCE);
lis2dtw12_power_mode_set(&dev_ctx, LIS2DTW12_CONT_LOW_PWR_LOW_NOISE_12bit);
/* Set Output Data Rate */
lis2dtw12_data_rate_set(&dev_ctx, LIS2DTW12_XL_ODR_25Hz);
-Eleon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-14 6:18 AM
