奇怪的问题, IICD不能给其他变量赋值(HCSQG08)

- UID
- 348621
- 性别
- 男
|
奇怪的问题, IICD不能给其他变量赋值(HCSQG08)
在下面的函数里,IICD赋值给其他变量,但是在Data窗口中看到IICDtemp的值是0 ,而此时IICD中的值是0x4c,是否有什么地方需要设置?
void EI2C1_OnRxChar(void)
{
/* Write your code here ... */
IIC_receivecount++;
IICS_IICIF = 1; // clear the interrupt flag
IICDtemp=IICD; //此处赋值不起作用
IICD_REG[iic_receive_byte_counter]= IICD;
iic_receive_byte_counter++ ;
if(PTAD_PTAD1==1) //IIC_REQ = 1,all bytes transfer complete
receive_complete = 1;
} [SHADOW=255,blue,1]IICDtemp=IICD[/SHADOW] |
|
|
|
|
|

- UID
- 348621
- 性别
- 男
|
|
|
|
|
|
 
- UID
- 104380
- 性别
- 男
|
IICD既是发送数据寄存器,也是接收数据寄存器。具体作什么,要看IICC_TX位的设置。设置不同,读出的数也不同。 |
|
|
|
|
|

- UID
- 348621
- 性别
- 男
|
|
|
|
|
|

- UID
- 348621
- 性别
- 男
|
此时IICC_TX是"0",我是利用这一位向接受和发送函数跳转的
if (IICC_TX==0) EI2C1_OnRxChar();
else EI2C1_OnTxChar(); |
|
|
|
|
|

- UID
- 172853
- 性别
- 男
|
|
|
|
|
|