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.
Hello Jorgen ! With the help of your example, I made it work ! It was the waking up of the MPU6050 that was my problem ! Thank you, Jorgen ! I think this example should be part of a twi_example in the sdk.
Hello Jorgen ! With the help of your example, I made it work ! It was the waking up of the MPU6050 that was my problem ! Thank you, Jorgen ! I think this example should be part of a twi_example in the sdk.