Hi,
I got the BMI085 shuttle board setup in the following way, trying to interface it via an FT4232 Mini Module (which provides USB to I2C):
While I can read the gyro values successfully via:
std::array< uint8, 1 > buffer = { 0x02};
uint32 bytesTransferred = 0;
uint32 options = I2C_TRANSFER_OPTIONS_START_BIT;
auto status = I2C_DeviceWrite( m_ChannelHandle, 0x68, buffer.size(), buffer.data(), &bytesTransferred, options );
std::vector< uint8 > result;
result.resize( 6 );
options = I2C_TRANSFER_OPTIONS_START_BIT | I2C_TRANSFER_OPTIONS_STOP_BIT;
status = I2C_DeviceRead( m_ChannelHandle, 0x68, numBytesToRead, result.data(), &bytesTransferred, options );
The same procedure does not work for the accelerometer (of course substituting the device and register addresses).
It seems powering the acc up does not work correctly. Reading the ACC_CONF after power-up yields:
10001111 (binary) which is not a valid config. Trying to change it by sending a valid config (e.g. 0xA8) results in the same reading afterwards.
To put the acc from suspend into normal power mode I did as the datasheet said, writing 0x4 to register 0x7D.
But this seems to get lost too, as reading the power control register sometimes also indicates that the acc part is "off".
Can you spot any obvious mistakes? Is the acc initialisation wrong?
Hello bs910,
BMI085 accelerometer and gyroscope had different I2C address, could you change I2C address to access accelerometer?
Hi Robin,
thanks for your answer. The problem was that I did not NACK the last byte as specified.
I.e. instead of
options = I2C_TRANSFER_OPTIONS_START_BIT | I2C_TRANSFER_OPTIONS_STOP_BIT;
status = I2C_DeviceRead( m_ChannelHandle, 0x68, numBytesToRead, result.data(), &bytesTransferred, options );
it should be:
options = I2C_TRANSFER_OPTIONS_START_BIT | I2C_TRANSFER_OPTIONS_STOP_BIT | I2C_TRANSFER_OPTIONS_NACK_LAST_BYTE;
status = I2C_DeviceRead( m_ChannelHandle, 0x68, numBytesToRead, result.data(), &bytesTransferred, options );
Best Regards,
Ben
Hello bs910,
It is good to work well.