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
02-27-2022 04:41 AM - edited 02-27-2022 04:41 AM
Hello mehmetbekir,
You could refer attached BHI160B example code on STM32.
/* 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);
}
02-28-2022 08:58 AM
I tried but nothing changed. MY code is as below
03-02-2022 03:26 AM
Hello mehmetbekir,
You could read GPIO pin status. Could you directly run reference code and see it again?
03-03-2022 09:08 AM
I tried but no change. Only when the code is run for the first time an interrupt hits the INT pin and 9 bytes are read, then no interrupt.