I responded with a new post yesterday and now I don't see it, so not sure what happened... Something interesting: when I wrote 0x09 to register 0x34 (active high, push-pull, latched), the chip got very hot to the touch and accelerometer values were not read correctly. Once I reverted back to writing 0x01 to register 0x34 (active low, push-pull, latched), the chip immediately cooled down and accelerometer values were fine again. I wrote other values to 0x34 and they were all fine in terms of not heating up the chip or messing up the accelerometer values. I did implement the logic from your document in my initialization function: void BMA530_Init(void)
{
uint8_t buf[3];
// Soft reset the sensor
buf[0] = 0x7E;
buf[1] = 0xB6; // Soft-reset BMA530 to default settings
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 2, HAL_MAX_DELAY);
HAL_Delay(10); // Wait after reset
// Configure common control registers
buf[0] = BMA530_REG_ACC_CONF1; // Register 0x31
buf[1] = 0x04; // LPM mode, 25Hz ODR for low power consumption
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 2, HAL_MAX_DELAY);
buf[0] = BMA530_REG_ACC_CONF2; // Register 0x32
buf[1] = 0x0C; // ±2g range (maximum sensitivity), low noise
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 2, HAL_MAX_DELAY);
HAL_Delay(100); // Stabilization delay after configuration
// Configure INT1 pin to be push-pull, active low, latched interrupt
buf[0] = BMA530_REG_INT1_CONFIG; // Register 0x34
buf[1] = 0x01; // Active low, push-pull, latched interrupt
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 2, HAL_MAX_DELAY);
// Map the generic interrupt to INT1 pin
buf[0] = BMA530_REG_INT_MAP_0; // Register 0x36
buf[1] = 0x40; // Map gen1 signal to INT1 pin
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 2, HAL_MAX_DELAY);
HAL_Delay(10); // Stabilization delay
// Configure generic interrupt 1 (gen1) parameters for high sensitivity
// Access feature engine register x04 in extended memory map (register 0x5E)
buf[0] = 0x5E;
buf[1] = 0x04;
buf[2] = 0x00; // Add the second byte for the 16-bit address
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 3, HAL_MAX_DELAY);
// Set gen1 slope threshold to a very low value (e.g., 0.01g)
buf[0] = 0x5F;
buf[1] = 0x00; // MSB
buf[2] = 0x01; // LSB (slope threshold for high sensitivity)
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 3, HAL_MAX_DELAY);
// Access feature engine register 0x05
buf[0] = 0x5E;
buf[1] = 0x05;
buf[2] = 0x00;
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 3, HAL_MAX_DELAY);
// Set gen1 hysteresis and reference
buf[0] = 0x5F;
buf[1] = 0x02; // MSB
buf[2] = 0x00; // LSB (minimal hysteresis for maximum sensitivity)
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 3, HAL_MAX_DELAY);
// Access feature engine register 0x06 in extended memory map (register 0x5E)
buf[0] = 0x5E;
buf[1] = 0x06;
buf[2] = 0x00; // Add the second byte for the 16-bit address
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 3, HAL_MAX_DELAY);
// Set gen1 duration and wait time
buf[0] = 0x5F;
buf[1] = 0x01; // Short duration for quick motion detection
buf[2] = 0x00;
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 3, HAL_MAX_DELAY);
// Enable generic interrupt 1
buf[0] = 0x55;
buf[1] = 0x01;
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 2, HAL_MAX_DELAY);
// Update feature engine for settings to take effect
buf[0] = 0x54;
buf[1] = 0x01;
HAL_I2C_Master_Transmit(&hi2c1, (BMA530_I2C_ADDR << 1), buf, 2, HAL_MAX_DELAY);
// Optional: Print register values for debugging
printRegisterValues();
} Before I said the interrupt was constantly triggering, but actually I was connecting the STM32 pin to the wrong pin on the adapter board that has the BMA530 shuttle board on it, so once I connected the pin correctly, the issue turned into the interrupt not triggering at all with movement. I set the STM32 interrupt to trigger on the rising or falling edge, and tested the STM32 interrupt by manually connecting it to ground and 3.3V, and it triggered as expected, so the STM32 interrupt was configured correctly. I'm not sure what the issue is.
... View more