I am using nrf51822, sdk version 11.0, sofdevice 130, i2c initialized in non-blocking mode. The read seems ok. The write is problematic for me.
I am using nrf51822, sdk version 11.0, sofdevice 130, i2c initialized in non-blocking mode. The read seems ok. The write is problematic for me.
Which I2C device are you trying to write to? You will have to look in the datasheet of the device you are interfacing to know how to perform a write operation.
Typically you put the register address and your data into a buffer and then transfers this to the device using a single nrf_drv_twi_tx() call. See for instance the function eeprom_write()
in TWIS Slave and TWI Master mode drivers Example in the SDK.
Here is an example project for the MPU-6050. Can you test it out if you did not get it working yet?
Here is an example project for the MPU-6050. Can you test it out if you did not get it working yet?