CC2538 是不是I2C不能用,芯片silicon级别的bug?
时间:10-02
整理:3721RD
点击:
1、是不是CC2538 i2c有bug,TI也只给了个头文件,示例程序都不提供,调试了几天,I2C通讯一直有问题,就想给7-bit的0x50从机发送两个字节的数据,0x15,0x26
//set slave address(Device Address) I2CMasterSlaveAddrSet(slaveAddr,false); //false:write //set sub address(Word Address) I2CMasterDataPut(subAddr); I2CMasterControl(I2C_MASTER_CMD_BURST_SEND_START); //star+run // Wait until master module is done transferring. while(I2CMasterBusy()){} // Place the data to be sent in the data register I2CMasterDataPut(data); I2CMasterControl(I2C_MASTER_CMD_BURST_SEND_CONT); I2CMasterControl(I2C_MASTER_CMD_BURST_SEND_ERROR_STOP); // Wait until master module is done transferring. while(I2CMasterBusy()){}
2、这是从器件要求的时序,发送完slave address以后不能直接stop的,要接着发送word address(sub address),然后是data,最后才能stop。
3、TI给的CC2538 I2c loopback示例代码不好用,还有别的示例程序吗?
4、另外,CC2538 IAR download and debug过程中意外崩溃,导致CC2538 再也无法识别了,XDS100V3也连不上,显示Unkown,@VV ,问一下TI有没有内部工具解锁的? 在e2e上问了也没人知道
cc2538 foundation software里还有一个基础功能的i2c例程: http://www.ti.com/tool/cc2538-sw
谢谢,搞定了