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
10-27-2020 10:09 PM
10-28-2020 03:11 PM
Hi minhwan,
Thank you for your replay,
Till now i am getting acc and gyro raw data in x,y,z co-ordinates with my source code of BMX160. How can i convert it into pitch,roll, yaw?
I should use your suggested code for my magnetometer config.
1) I am confusing about BMX160 device because for mag config your using bmm150.c/.h, In BMX160 DATASHEET in(pg:14) block
diagram shows within the IC.
2) Actually i am SPI interface for ACC & GYRO data reading, but MAG interface (bmm150) your using I2C in like below
static void init_bmm150_sensor_driver_interface(void)
{
/* I2C setup */
/* link read/write/delay function of host system to appropriate
* bmi160 function call prototypes */
i2c_bus = BMM150_DEFAULT_I2C_ADDRESS;
bmm150dev.intf_ptr = &i2c_bus;
bmm150dev.intf = BMM150_I2C_INTF;
bmm150dev.read = bmm150_aux_read;
bmm150dev.write = bmm150_aux_write;
bmm150dev.delay_us = bmm150_delay_usec;
}
How can i change from I2C to SPI? If i change it, but how it will work means how BMX160 can communicate with bmm150(mag) using SPI or I2C?
3) Is my external SPI is same as internal SPI of bmm150?
Pl suggest me to to overcome these doubts,like by showing web links or any pdf files.
Thank you,
regards,
amarr
10-28-2020 08:03 PM
Hello Amar,
1) BMX160 is BMI160 with build-in BMM150. That's why we re-use existed BMM150 code for internal BMM150.
2) The SPI interface you have is for communication between BMX160 and your host MCU. BMM150 inetface is for communication between BMX160 internally.
3) I think 2) answer can give you answer for 3) as well.
Thanks,
10-29-2020 03:13 PM
Hi minhwan.
Thank you for replay,
1) If i use bmi160 with spi interface then which interface can i use for bmm150, is it SPI or I2C?
2) Can i config bmi160 and bmm150 with same SPI interface which i used for communicating with host to bmi160.
3) If i config bmi160 with SPI and bmm150 with I2C, then how can i read MAG data from bmm150 because two are different protocols.
So please help to understand its internal architecture for reading MAG data from it.
one again Thank you so much for replay.
amarr