10-24-2022 12:03 PM - edited 10-24-2022 12:43 PM
Hello,
I'm trying to use the FIFO tag feature for the BMI085 IMU in my application, as described in this document: https://www.bosch-sensortec.com/media/boschsensortec/downloads/application_notes_1/bst-mis-an005.pdf...
Below is the code snippet which should set the interrupt INT1 pin as input:
struct bmi08x_accel_int_channel_cfg accel_fifo_int = {0};
int8_t status;
accel_fifo_int.int_channel = BMI08X_INT_CHANNEL_1;
accel_fifo_int.int_type = BMI08X_ACCEL_SYNC_INPUT;
accel_fifo_int.int_pin_cfg.output_mode = BMI08X_INT_MODE_PUSH_PULL;
accel_fifo_int.int_pin_cfg.lvl = BMI08X_INT_ACTIVE_HIGH;
accel_fifo_int.int_pin_cfg.enable_int_pin = BMI08X_ENABLE;
status = bmi08a_set_int_config(&accel_fifo_int, bmi08x_dev);
For the int_type field I choose the BMI08X_ACCEL_SYNC_INPUT because all other enums are used for the output configuration. The same configuration I've used is also used in the read_synchronized_data_mcu.c official example (https://github.com/BoschSensortec/BMI08x-Sensor-API/tree/master/examples/read_synchronized_data_mcu).
After the configuration, I read the register FIFO_CONFIG_1 (address 0x49) and it's state is: 0x58, which seems to be correct:
Before call to the bmi08a_read_fifo_data function is made, I set the GPIO pin from the MCU which is connected to INT1 pin on the IMU to the HIGH (1) state for 1 ms and then to the LOW state (0). Only after that pulse on the INT1 line, I call the bmi08a_read_fifo_data function.
Then, when the internal (static) driver function extract_acc_header_mode is called, I check the extracted header frame to see if the generated pulse event is recorded and it's state is always equal to 0x84 (0b 1000 0100), which according to the section 3.2.1 Acceleration sensor data frame means the following:
I've also tried to keep the INT1 high all the time, but the result is the same, i.e. bit 0 (INT1 tag) in accelerometer header frame is always set to 0.
Any help would be appreciated.
P.S. A suggestion from my side would be to add the FIFO tag application example in the list of the provided examples on Github (https://github.com/BoschSensortec/BMI08x-Sensor-API/tree/master/examples).
Best regards,
Dino.
11-10-2022 04:12 AM
Hi dcindric28,
Do you want to read FIFO data or the synchronous data of accel and gyro?
If you just to read FIFO data, you need to set int_type is set to BMI08X_ACCEL_INT_FIFO_WM.
If you want to synchronize accel and gyro data, refer to the example read_synchronized_data_mcu.c to read the synchronization data.
If you run read_synchronized_data_mcu.c and also read FIFO data again. How do you synchronize accel and gyro data in FIFO? read_synchronized_data_mcu.c has demonstrated reading synchronous data.
11-13-2022 11:05 AM
Hi BSTRobin,
Thank you for your response, but I was not referring to the readout of the synchronized accelerometer and gyroscope data and I'm familiar with that example. To further clarify, I'm interested in the tag application, mentioned in sections 3.1.3 and 4.1.2 of the BMI08X FIFO Usage application note:
https://www.bosch-sensortec.com/media/boschsensortec/downloads/application_notes_1/bst-mis-an005.pdf
I want to have tagged accelerometer and gyroscope data based on the state of interrupt pins. For example, if I configure the INT1 pin, which is tied to the accelerometer, and the INT3 pin, which is internally tied to the gyroscope, as input pins and accordingly set the bit 3 in the FIFO_CONFIG_1 register (address 0x49) and bit 5 in the register FIFO_EXT_INT_S (0x34) to logical 1, the tag mode should be enabled. To cite the application note:
Section 3.1.3 FIFO synchronization with external interrupts
If the INT1 and/or INT2 pin is configured as input pin (by setting int2_io in register INT2_IO_CTRL
and/or setting int1_io in register INT1_IO_CTRL), signals on these pins can also be recorded in
the FIFO, and the frames are “tagged” accordingly. Therefore the pins need to be activated for
FIFO recording in register FIFO_CONFIG_1 (see 3.5.7).
Section 4.1.2 FIFO synchronization with external interrupts (tag application) for the gyroscope
...In order to enable the tag mode, bit 5 must be set in register 0x34 (see 0). The pin can be chosen
in the same register, bit 4. The remaining 15 bits of the z-axis gyroscope data keep the same meaning
as in standard mode.
Once the pin, which is configured for the tag mode, is set to high level, the next FIFO word will be
marked with a tag (z-axis LSB = 1). While pin is kept at a high level, the corresponding FIFO
words will continuously be tagged. After the pin is reset to low level, the immediate next FIFO
word could still be tagged, and only after this word, the next tag will be reset (z-axis LSB=0).
I've implemented all of the above-mentioned procedures in my code (as described in my previous post) and checked the state of all relevant registers, which showed that all the bits are set correctly according to the application note I'm referring to, but without any success - bit 0 (INT1 tag) in accelerometer header frame is always set to 0, independent of the state of INT1 pin, and gyroscope data sometimes has LSB equal 0 even if the INT3 is active.
Examples and any additional help for the tag mode would be highly appreciated since this is a deal breaker for the application I'm developing (100+ units).
Best regards,
Dino.
01-13-2023 04:12 AM
Hi dcindric28,
"FIFO synchronization with external interrupts" was used to synchronize the data of accel and gyro. The example code is https://github.com/boschsensortec/BMI08x-Sensor-API/tree/master/examples/read_synchronized_data_mcu
"FIFO synchronization with external interrupts(tag application) for the gyroscope" was used to synchronize the data of other sensors(sensor other than accel) and gyro, currently there was no example for it.
What is your application? If you only want to synchronize accel and gyro data, this example read_synchronized_data_mcu is enough for you.