我在进行写操作时:
我应用的是dsp28035,I2C写操作配置如下:
I2caRegs.I2CCNT = 3;
I2caRegs.I2CDXR = (UINT16)(u16Address & 0x00ff);
I2caRegs.I2CDXR =data[0];
I2caRegs.I2CDXR = data[1];
//I2caRegs.I2CDXR = data[2];
//I2caRegs.I2CDXR = data[3];
I2caRegs.I2CMDR.all = 0x6E20;
运行完这步时,通过cccs的window查看变量,结果I2caRegs.I2CMDR.all=0x4220,这点为明白STT和
STP置1后,这两位会自动清零。
但是我修改程序如下:
I2caRegs.I2CCNT = 5;
I2caRegs.I2CDXR = (UINT16)(u16Address & 0x00ff);
I2caRegs.I2CDXR =data[0];
I2caRegs.I2CDXR = data[1];
I2caRegs.I2CDXR = data[2];
I2caRegs.I2CDXR = data[3];
I2caRegs.I2CMDR.all = 0x6E20;
运行完这步时,通过cccs的window查看变量,结果I2caRegs.I2CMDR.all=0x6E20,STT和STP置1后,这两位为何不能自动清零呢。
mangui zhang:
请查看附件 有IIC详细的说明
我在进行写操作时:
我应用的是dsp28035,I2C写操作配置如下:
I2caRegs.I2CCNT = 3;
I2caRegs.I2CDXR = (UINT16)(u16Address & 0x00ff);
I2caRegs.I2CDXR =data[0];
I2caRegs.I2CDXR = data[1];
//I2caRegs.I2CDXR = data[2];
//I2caRegs.I2CDXR = data[3];
I2caRegs.I2CMDR.all = 0x6E20;
运行完这步时,通过cccs的window查看变量,结果I2caRegs.I2CMDR.all=0x4220,这点为明白STT和
STP置1后,这两位会自动清零。
但是我修改程序如下:
I2caRegs.I2CCNT = 5;
I2caRegs.I2CDXR = (UINT16)(u16Address & 0x00ff);
I2caRegs.I2CDXR =data[0];
I2caRegs.I2CDXR = data[1];
I2caRegs.I2CDXR = data[2];
I2caRegs.I2CDXR = data[3];
I2caRegs.I2CMDR.all = 0x6E20;
运行完这步时,通过cccs的window查看变量,结果I2caRegs.I2CMDR.all=0x6E20,STT和STP置1后,这两位为何不能自动清零呢。
user3900194:
回复 mangui zhang:
你好,能否给详细指点一下,.I2CCNT 数值不同,怎么还影响了I2caRegs.I2CMDR值呢?我就如我开始的疑问一样,I2CCNT =3和I2CCNT =5时的结果完全不一样,感觉I2CCNT =3时是对的,I2CCNT =5时,I2CMDR结果就不对,即stp没有自动清零,不知道为何?期待帮助,谢谢
我在进行写操作时:
我应用的是dsp28035,I2C写操作配置如下:
I2caRegs.I2CCNT = 3;
I2caRegs.I2CDXR = (UINT16)(u16Address & 0x00ff);
I2caRegs.I2CDXR =data[0];
I2caRegs.I2CDXR = data[1];
//I2caRegs.I2CDXR = data[2];
//I2caRegs.I2CDXR = data[3];
I2caRegs.I2CMDR.all = 0x6E20;
运行完这步时,通过cccs的window查看变量,结果I2caRegs.I2CMDR.all=0x4220,这点为明白STT和
STP置1后,这两位会自动清零。
但是我修改程序如下:
I2caRegs.I2CCNT = 5;
I2caRegs.I2CDXR = (UINT16)(u16Address & 0x00ff);
I2caRegs.I2CDXR =data[0];
I2caRegs.I2CDXR = data[1];
I2caRegs.I2CDXR = data[2];
I2caRegs.I2CDXR = data[3];
I2caRegs.I2CMDR.all = 0x6E20;
运行完这步时,通过cccs的window查看变量,结果I2caRegs.I2CMDR.all=0x6E20,STT和STP置1后,这两位为何不能自动清零呢。
user3900194:
回复 user3900194:
怎么没人回答呢,请大侠们出手相助啊,谢谢