‎2020-07-11 08:38 AM
in bno055's datasheet adress shown as 0x28 or 0x29 (in decimal 40 and 41) but when ı use i2c adress finding function it returns 80. To be sure about adress I writed following code but there is strange issue. When code is like that firstly d becames 2 , after 10 second d becames 4. What is problem about and what should ı do?
Note: I use stm32f4 and i2c1 with pb8 and pb9 pins.
if(HAL_I2C_IsDeviceReady(&hi2c1 ,40, 1, 100)==HAL_OK)
d=1;
else if(HAL_I2C_IsDeviceReady(&hi2c1 ,80, 1, 100)==HAL_OK){
d=2;
HAL_Delay(10000);}
else if(HAL_I2C_IsDeviceReady(&hi2c1 ,41, 1, 100)==HAL_OK)
d=3;
else
d=4;
Thanks for looking =)
Solved! Go to Solution.
‎2020-07-12 05:59 PM
Ok, on the STM32 the I2C uses the 7-bit addressing which is shifted into the high order bits, like it is on the bus
ie (0x28 << 1) --> 01010000
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bno055-ds000.pdf
‎2020-07-12 05:59 PM
Ok, on the STM32 the I2C uses the 7-bit addressing which is shifted into the high order bits, like it is on the bus
ie (0x28 << 1) --> 01010000
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bno055-ds000.pdf
‎2020-07-13 05:14 AM
Thank you very much. You helped me to solve my confusion.:smiling_face_with_smiling_eyes: