10-27-2020 08:13 AM
Hi everyone,
I am trying to read BMX160's ACC and GYRO data, as part of doing this i am able read its device id as 0xD8 and then i configured its ACC and GYRO into
NORMAL MODEs and trying to read its raw raw data from 12 registers(0x0C-0x17).
Till now i am able to read GYRO data(I saw gyro data on MISO), but for ACC i am not getting any data(x,y,z) on MISO even by moving the sensor also.
Note:- Can we read ACC raw data directly by config its reg or is it depends GYRO or MAG data also?
Please help mje to come out this issue.
Thanks in advance.
Regards,
amarr
11-04-2020 12:52 AM
Hello Amar,
1) For reading MAG data or even BMM150 Chip_id also, Finally we get data from SPI only because it is the bmi160 primary interface. right?
- Right 🙂
2) Eventhough if you call " bmm_init();" API, still it will use spi_read/spi_write of bmi160 driver via aux_interface of bmi160 like below
bmm150_init(&bmm); ---> bmm150_get_regs ----->dev->intf_rslt = dev->read(reg_addr, reg_data, len, dev->intf_ptr); ---->bmm150_aux_read() ---- -------->bmi160_aux_read. right?
- The SPI communcation between host MCU and BMX160 is running via primary interface, not AUX interface. AUX interface is for BMM150 and BMI160 internally.
3) How do we know bmi160 aux_interface working fine or not?
- when you call bmm150_init function, and get -2 error, it means communcation failure.
4) Can i change bmi160 aux_interface to SPI from I2C?
- No.
5) Can i read MAG data directly form bmm150(without using bmm150 driver), if yes can you please suggest me how to implement it.
- You can only read mag data thru primary interface.
Thanks 🙂
11-04-2020 06:34 PM
Hi minhwan,
In source code which API can i use SPI or I2C for rading ACC/GYRO and MAG because for bmi160 i initialize in spi API and for bmm150 i2c API?
If i use bmm150 API for MAG, finally it should use bmi160 SPI API, but how it will work internally(bmi160 to bmm150) because aux interface of bmx160 I2C only.
How spi will pass write or reg data into bmm150? and also in bmx160 datasheet no where given for this bmm150 interface for MAG, why?
Thanks in advance
amarr
11-06-2020 07:24 PM
Hello Amar,
Yes, you can use I2C/ SPI interface between host MCU and BMI160, and I2C interface between BMI160 and BMM150 ( this is BMX160 internal)
You can also check BMX160 block diagram in datasheet page 14 how BMX160 works.
Because BMX160 concept is kind of combination with BMI160 and BMM150, we short commented it in BMX160 datasheet page 26.
Thanks,