Hi @Kelvin_Huang @KevinKL Ameba Community,
I’m facing persistent I2C issues when trying to interface a Bosch BMI270 IMU (6-axis accel/gyro) with the AMB82-MINI board using the AmebaPro2 Arduino SDK. The scanner detects the device at 0x68/0x69, but reads fail (e.g., WHO_AM_I register returns 0x00 instead of expected 0x24), and the Bosch library init returns -2 (BMI2_E_DEV_NOT_FOUND). No data can be read, and earlier attempts caused pin heating (now resolved, possibly wiring-related).
Setup:
-
Board: AMB82-MINI (RTL8735BDM)
-
IDE: Arduino IDE 2.3.3 with AmebaPro2 package (latest)
-
Library: Bosch BMI270-Sensor-API (from GitHub, placed in libraries folder)
-
Wiring (3.3V logic):
-
BMI270 VDD/VDDIO → AMB82 3.3V
-
GND → GND
-
SDA (BMI270 pin 7) → Pin 12 (PE4/SDA)
-
SCL (BMI270 pin 6) → Pin 13 (PE3/SCL)
-
SDO (BMI270 pin 8): Left unconnected (defaults to 0x68)
-
Pull-ups: 2.2kΩ on breakout board (SDA/SCL to 3.3V)
-
-
Power: Via Micro USB (stable 3.3V measured)
#include <Wire.h>
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
Wire.begin(); // Default I2C master mode on pins 12 (SDA) and 13 (SCL)
Wire.setClock(100000); // Set I2C to 100kHz for reliability
delay(1000); // Allow time for stabilization
// Manual I2C Scan and WHO_AM_I check
Serial.println(“Scanning I2C bus and checking BMI270…”);
uint8_t addresses = {0x68, 0x69}; // Possible BMI270 addresses
for (int i = 0; i < 2; i++) {
Wire.beginTransmission(addresses\[i\]);
uint8_t error = Wire.endTransmission();
if (error == 0) {
Serial.print("Device found at 0x");
if (addresses\[i\] < 16) Serial.print("0");
Serial.println(addresses\[i\], HEX);
// Read WHO_AM_I register (0x00)
Wire.requestFrom(addresses\[i\], (uint8_t)1);
if (Wire.available()) {
uint8_t who_am_i = Wire.read();
Serial.print("WHO_AM_I at 0x");
if (addresses\[i\] < 16) Serial.print("0");
Serial.print(addresses\[i\], HEX);
Serial.print(" = 0x");
if (who_am_i < 16) Serial.print("0");
Serial.println(who_am_i, HEX);
if (who_am_i == 0x24) {
Serial.println("BMI270 detected! Proceeding with basic read...");
// Basic accel read (register 0x12-0x17 for X/Y/Z)
Wire.beginTransmission(addresses\[i\]);
Wire.write(0x12); // Start at accel X LSB
Wire.endTransmission(false); // Restart
Wire.requestFrom(addresses\[i\], (uint8_t)6);
if (Wire.available() == 6) {
int16_t accel_x = (Wire.read() | (Wire.read() << 8)) / 8192.0; // 4G range
int16_t accel_y = (Wire.read() | (Wire.read() << 8)) / 8192.0;
int16_t accel_z = (Wire.read() | (Wire.read() << 8)) / 8192.0;
Serial.print("Accel (g): X="); Serial.print(accel_x);
Serial.print(" Y="); Serial.print(accel_y);
Serial.print(" Z="); Serial.print(accel_z);
Serial.println();
} else {
Serial.println("Failed to read accel data.");
}
} else {
Serial.println("Device at this address is not BMI270 (wrong WHO_AM_I).");
}
} else {
Serial.println("No response from WHO_AM_I register.");
}
} else {
Serial.print("No device at 0x");
if (addresses\[i\] < 16) Serial.print("0");
Serial.println(addresses\[i\], HEX);
}
delay(100); // Brief delay between checks
}
Serial.println(“Scan and check complete.”);
}
void loop() {
// No continuous loop needed for this test
delay(1000);
}
Any advice? Is there an AMB82-MINI I2C quick (e.g., pin remap, SDK bug)? Has anyone interfaced BMI270 successfully? Happy to share wiring photos.
Thanks!
Madava Ramagiri
