I decided to move to 16 SDK, but I have problems with TWI. Whenever I try to read data from sensor, I get only 0 as the output. I use sensors ICM-20600.
When I try to read data from the accelerometer and gyroscope, I get 0. But on sdk 14.2 these sensors work perfectly
TWI Initialization:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void twi0_init(void) {
const nrf_drv_twi_config_t twi_lsm330dlc_config = {
.scl = SCL0_PIN,
.sda = SDA0_PIN,
.frequency = NRF_TWI_FREQ_400K,
.interrupt_priority = APP_IRQ_PRIORITY_LOWEST,
.clear_bus_init = true};
APP_ERROR_CHECK(nrf_drv_twi_init(&m_twi0, &twi_lsm330dlc_config, twi_handler, NULL));
nrf_drv_twi_enable(&m_twi0);
}
//twi_init
static void twi1_init(void) {
const nrf_drv_twi_config_t twi_lsm330dlc_config = {
.scl = SCL1_PIN,
.sda = SDA1_PIN,
.frequency = NRF_TWI_FREQ_400K,
.interrupt_priority = APP_IRQ_PRIORITY_LOWEST,
.clear_bus_init = true};