
- UID
- 152125
- 性别
- 男
|
用的单片机是9S12DG128B,技术文档说
The TCF bit will be cleared by reading from the IIC Bus Data I/O Register
(IBDR) in receive mode or writing to IBDR in transmit mode.
用C语言,初始化为
void IIC_Init(void)
{
IBFD=0x9c;
IBAD=0x50;
IBCR=0x80;
}
然后主程序中
IBCR=(IBCR|0x30);//make a START,transmit mode
IBDR=0x22;
然后马上查IBSR_TCF位却是1。
主要想问是,在发送中,应该IBSR_TCF为0;为什么会为1。
上面的程序是不是哪里有错漏。是不是写给IBDR后数据没有发送导致的。
|
|