02-26-2022 06:41 PM
Hello. I want to receive data from BHI160 sensor using microcontroller(STM32). For this, I added the library related to the company's MCU solution to my own project. The return values of bhy_initialize_support(),bhy_driver_init(&bhy1_fw),bhy_install_sensor_callback() and bhy_enable_virtual_sensor() functions are 0 so they are successful but when I try to read data from fifo the INT pin is only It goes high the first time, then it stays low all the time, so there is no interrupt. what would be the reason
03-10-2022 06:59 AM
Hello mehmetbekir,
Sorry, you could read interrupt status register 0x36 value, bit0 is host status. Previous attachment reference code work well on my side with STM32F4, could you try to only run the reference code?
/* wait until the interrupt fires */
/* unless we already know there are bytes remaining in the fifo */
while (!bhi160b_get_int_status() && !bytes_remaining);
int bhi160b_get_int_status()
{
uint8_t value;
bhy_read_reg(BHY_I2C_REG_INT_STATUS_ADDR, &value, 1);
return(value&0x01);
}
03-10-2022 09:53 AM
I don't use external sensors. I just use the BHI160 chip. Could it have something to do with it not working?
03-15-2022 10:05 AM
Hello mehmetbekir,
This is the code to access the BHI160 register, not the external sensor.
05-30-2022 06:36 PM - edited 05-30-2022 08:31 PM
I have a similar problem.
All initialization steps pass with BHY_SUCCESS. Read product ID: 0x83. I receive the first interrupt. Then, I receive 10 bytes in the FIFO decoded as follows:
bhy_meta_event_type_t: BHY_META_EVENT_TYPE_ERROR
bhy_data_meta_event_t.meta_event_id: 254
bhy_data_meta_event_t.event_number: 4
bhy_data_meta_event_t.sensor_type: 33
bhy_data_meta_event_t.event_specific: 21
Then no interrupt, and FIFO always has zero bytes_remaining.
I am using BHI160B, the latest standalone firmware (Bosch_PCB_7183_di03_BMI160-7183_di03.2.1.11824). STM32L4 MCU. I am running the rotation_vector_example.c code.
SOLVED:
It turned out our electrical hardware designer missed the pull-up resistors for the auxiliary I2C bus.
06-14-2022 04:51 AM
Good news.