This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我这边出现了I2C读写无效的问题,查看论坛,发现多年以前也出现了类似的例子,https://e2echina.ti.com/support/machine-translation/mt-clock-timing/f/mt-clock-timing-forum/497571/cdce813-q1-i2c-i2c/1746587?tisearch=e2e-sitesearch&keymatch=CDCE813#1746587
可能是什么原因?
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -r 0x00
Reg value: 0x7
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -r 0x01
Reg value: 0x7
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -r 0x00
Reg value: 0x7
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -r 0x01
Reg value: 0x7
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -w "0x02 0x87"
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -r 0x02
Reg value: 0x7
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -w "0x01 0x17"
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -r 0x01
Reg value: 0x7
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -w "0x02 0x87"
/mnt # /customer/i2c_read_write -b 5 -a 0xca -f A8D8 -r 0x02
Reg value: 0x7
看您时序图中CommandCode 使用的是Block Write 操作,但是在您的时序中如下截图红色箭头处变成了stop (红框处所述),因此应该是这里的问题造成写入无效。
如您放大处波形所示,时钟波形有些异常,这块应该不满足脉冲宽度和建立、保持时间要求:
另外,根据Block Write 协议,第三个字节是要写入的字节数,看您时序图第三个字节数字很大,感觉不像是您定义的要写入的字节数:
可以提供一个正常的波形图吗?
很抱歉没有波形图提供给您,但是你可以参考上面截图figure 11.
应该是commandcode不对,我上面的波形没有加command code,我使用的是byte read,bit 7为1,这个code的bit6:0代表的是寄存器地址