Hi Thanks for the reply. I checked both PDF and adjusted my code. When I perform the self test I get values (x=12599LSB, y=13235LSB, z=13589LSB) So the self test passes. The calibartion (fast compensation +-2G) gave me (x=-5LSB, y=1LSB, z=-2LSB). But when the chip is flat on my desk with a refresh rate of 125Hz I get these values: x: 16,0 mg y: 51,172 mg z: -25,252 mg x: 15,0 mg y: 53,216 mg z: -21,240 mg x: 17,0 mg y: 54,116 mg z: -19,240 mg x: 18,0 mg y: 54,16 mg z: -23,252 mg x: 20,0 mg y: 50,184 mg z: -20,96 mg So I think, I do something wrong with the conversion of LSB to g or mg. volatile uint16_t tmpx = 0, tmpy = 0, tmpz = 0;
volatile uint8_t MSBx = 0, LSBx = 0, MSBy = 0, LSBy = 0, MSBz = 0, LSBz = 0;
volatile float factor = 0.488; //mg/LSB 8000/2^14 for range of +-4G
// X-Axis in 0x02-0x03
LSBx = BMA280_read_register(USART1, BMA280_ACCD_X_LSB);
MSBx = BMA280_read_register(USART1, BMA280_ACCD_X_MSB);
tmpx = (uint16_t)(((MSBx << | LSBx) >> 2);
acceleration[0] = (float) tmpx * factor; Is this the correct way? Thx for the previous help!! Best regards Nick
... View more