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.
Glad you got it working! The examples in the SDK should be as generic as possible and try to not target a specific device (unless this is a device used by the majority of customer group). Please accept this answer to help others find help if stuck on the same problem!
Glad you got it working! The examples in the SDK should be as generic as possible and try to not target a specific device (unless this is a device used by the majority of customer group). Please accept this answer to help others find help if stuck on the same problem!