Very nice Bosh, very nice. So while reading forum i noticed, that read bit is not LSB, but MSB !!!! Now lets see what datasheet is saying: So bit zero is actually 0x80 or 10000000. Switched code for MSB bit for read operation, and what do you know, right answer in first time 🙂 Pseudo code: CSA LOW SEND(ADR | 0x80) SEND(0)//DUMMY DATA=SEND(0) CSA HIGH STM32L5 code: uint8_t BMI085_Read_Register_ACC(uint8_t adr) { uint8_t data = 0; SPI1_CSG_GPIO_Port->HIGH = SPI1_CSA_Pin|SPI1_CSG_Pin; SPI1_CSG_GPIO_Port->LOW = SPI1_CSA_Pin; asm("nop");asm("nop");asm("nop");asm("nop");asm("nop"); SPI1_Send_Recieve_byte(adr|0x80); SPI1_Send_Recieve_byte(0); data = SPI1_Send_Recieve_byte(0); asm("nop");asm("nop");asm("nop");asm("nop");asm("nop"); asm("nop");asm("nop");asm("nop");asm("nop");asm("nop"); asm("nop");asm("nop");asm("nop");asm("nop");asm("nop"); SPI1_CSG_GPIO_Port->HIGH = SPI1_CSA_Pin|SPI1_CSG_Pin; return data; } Please fix datasheet and add some complete SPI timing diagram. Just as i suspected, extremely poorly written datasheet !
... View more