Hello, So I've tried bringing the pins low before power off and high after power on, but I still can't get it to initialize correctly. I've extracted the relevant parts in the code below. ##################################################################################################### digitalWrite(BMI270_CS, LOW); //Connected to CSB digitalWrite(11, LOW); //Connected to SDX digitalWrite(13, LOW); //Connected to SCX delay(200); digitalWrite(IMUpin, HIGH); //Turn off IMU high side switch wakeupSource = Snooze.deepSleep( button_config ); //Put uController to sleep digitalWrite(IMUpin, LOW); // Turn on IMU high side switch digitalWrite(11, HIGH); digitalWrite(13, HIGH); SPI.begin(); delay(500); /* Configure SPI pins to be used by IMU */ digitalWrite(BMI270_CS, HIGH); SPI.setMOSI(11); SPI.setMISO(12); SPI.setSCK(13); initResult = imuInit(); // Init the IMU int8_t imuInit() { /* Variable to define result */ int8_t rslt; /* Define sensor types in the data struct */ sensor_data[0].type = BMI2_ACCEL; sensor_data[1].type = BMI2_GYRO; /* Initialize the read, write, and delay functions for the bmi2 struct */ spi_bus = BMI270_CS; bmi2.intf_ptr = &spi_bus; bmi2.intf = BMI2_SPI_INTF; bmi2.read = BMI270_read_spi; bmi2.write = BMI270_write_spi; bmi2.read_write_len = 32; bmi2.delay_us = bmi2xy_hal_delay_usec; /* Config file pointer should be assigned to NULL, so that default file address is assigned in bmi270_init */ bmi2.config_file_ptr = NULL; int8_t chip_id; /* Initialize bmi270 */ rslt = bmi270_init(&bmi2); /* Return 0 on error */ if (rslt != BMI2_OK) return 0; /* Set sensor configurations */ rslt = bmi2_accel_gyro_set_config(&bmi2); /* Return 0 on error */ if (rslt != BMI2_OK) return 0; /* Wait for init to complete */ delay(250); /* Interrupt PINs configuration */ struct bmi2_int_pin_config data_int_cfg; /* Configure interrupt to pin 1 */ data_int_cfg.pin_type = BMI2_INT1; data_int_cfg.int_latch = BMI2_INT_NON_LATCH; /* Interrupt output enabled */ data_int_cfg.pin_cfg[0].output_en = BMI2_INT_OUTPUT_ENABLE; /* OpenDrain disabled */ data_int_cfg.pin_cfg[0].od = BMI2_INT_PUSH_PULL; /* Interrupt signal set tp active high */ data_int_cfg.pin_cfg[0].lvl = BMI2_INT_ACTIVE_HIGH; /* Interrupt input disabled */ data_int_cfg.pin_cfg[0].input_en = BMI2_INT_INPUT_DISABLE; /* Set interrupt configuration with newly defined parameters */ rslt = bmi2_set_int_pin_config( &data_int_cfg, &bmi2); /* Return 0 on error */ if (rslt != BMI2_OK) return 0; /* Return 1 on successful */ return 1; } ########################################################################################################### imuInit always returns 0. Any idea what I'm doing wrong? Thanks.
... View more