2024-06-04 01:21 AM
Hi,
I am using AIS2IH.
I can see in terminal window of my computer
that registers of data and temperature are zero's. 0 0 0 ...
My program use the setup:
ais2ih_cs_mode_set(&dev_ctx, AIS2IH_PULL_UP_DISCONNECT);
ais2ih_i2c_interface_set(&dev_ctx, AIS2IH_I2C_DISABLE);
ais2ih_spi_mode_set(&dev_ctx, AIS2IH_SPI_4_WIRE);
ais2ih_reset_set(&dev_ctx, PROPERTY_ENABLE);
platform_delay(0x00333333);
ais2ih_reset_get(&dev_ctx, &rst);
platform_delay(0x00333333);
ais2ih_reset_get(&dev_ctx, &rst);
platform_delay(0x00333333);
ais2ih_cs_mode_set(&dev_ctx, AIS2IH_PULL_UP_DISCONNECT);
ais2ih_i2c_interface_set(&dev_ctx, AIS2IH_I2C_DISABLE);
ais2ih_spi_mode_set(&dev_ctx, AIS2IH_SPI_4_WIRE);
/* Set full scale */
ais2ih_full_scale_set(&dev_ctx, AIS2IH_2g);
/* Set Output Data Rate */
ais2ih_data_rate_set(&dev_ctx, AIS2IH_XL_ODR_400Hz);
ais2ih_filter_path_set(&dev_ctx, AIS2IH_LPF_ON_OUT);
ais2ih_filter_bandwidth_set(&dev_ctx, AIS2IH_ODR_DIV_4);
ais2ih_self_test_set(&dev_ctx, AIS2IH_XL_ST_DISABLE );
/* Configure power mode */
ais2ih_power_mode_set(&dev_ctx, AIS2IH_HIGH_PERFORMANCE_LOW_NOISE);
memset(data_raw_acceleration, 0x00, 3 * sizeof(int16_t));
ais2ih_acceleration_raw_get(&dev_ctx, &data_raw_acceleration);
ais2ih_temperature_raw_get(&dev_ctx, &data_raw_temperature);
ais2ih_status_dup_get(&dev_ctx,& reg3);
sprintf((char *)tx_bufferL,"\n\t\r A[r]:%d,%d,%d; T[C]:%d; R:%u,DUP=%u",data_raw_acceleration[0],data_raw_acceleration[1],data_raw_acceleration[2],data_raw_temperature,tempraw,reg3);
strcat(tx_buffer, tx_bufferL);
strcat(tx_buffer,"\r\n\0");
tx_com(tx_buffer, strlen((char const *)tx_buffer));
Solved! Go to Solution.
2024-06-06 12:47 AM
So, the problem is with setup of the sensor.
2024-06-06 02:24 AM
Can I see your hardware?
2024-06-06 05:36 AM
2024-06-06 06:36 AM
OK?