This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52 + BMI160 on I2c

Hi,

I have a peculiar problem problem with BMI160 and nrf52. BMI160 is connected to nrf52 via pins 12 and 13. I am using peripheral/twi_sensor example. After configuring it via I2c I am able to read the chip ID of 0x1d , but the chip does not go to normal mode and the accelerometer value always return zero. Do you see any issues with the below code. Kindly help.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include
#include "boards.h"
#include "app_util_platform.h"
#include "app_error.h"
#include "nrf_drv_twi.h"
#include "nrf_delay.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "bmi160.h"
/* TWI instance ID. */
#define TWI_INSTANCE_ID 0
struct bmi160_dev sensor;
struct bmi160_sensor_data accel;
struct bmi160_sensor_data gyro;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX