Cannot write with i2c NRF52832 (TWI and TWIM)


Rodrigo Peixoto <rodrigopex@...>
 

Hi,
I am trying to use the i2c on my custom board. I can read data from the devices, but (oddly) I cannot write to any of the 3 devices "attached" to the i2c line. I am using SDA on pin P0.06 and SCL on pin P0.07. Any clue? I have already spent a lot of time trying to fix this and nothing seems to work in this direction. 

Zephyr version: 1.13

i2c configs:
prj file (begin)
...
CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_I2C_0_NRF_TWI=y
CONFIG_I2C_INIT_PRIORITY=60
CONFIG_SYS_LOG_I2C_LEVEL=4
CONFIG_I2C_0=y
...
prj file (end)

board.dts (begin)
...
&i2c0 {
status = "ok";
sda-pin = <6>;
scl-pin = <7>;
};
...
board.dts (end)

I am using the commands like: 
error = i2c_burst_read(i2c_dev, ACC_I2C_ADDR, reg, &temp, 1);
error = i2c_burst_read16(i2c_dev, ADE_I2C_ADDR, reg, &buf, 4);

error = i2c_burst_write(i2c_dev, ACC_I2C_ADDR, reg, &setup, 1);
error = i2c_burst_write16(i2c_dev, ADE_I2C_ADDR, reg, &buf, 3);

All the reading commands work and the writing ones do not show an error and seem to make no effect.  


Thank you.
Best regards,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex


Join users@lists.zephyrproject.org to automatically receive all group messages.