SCI1SR1_TDRE被置位1以后,需要读一下SCI1SR1寄存器把TDRE清除传送完成是看SCI1SR1的TC位 给一个例子程序参考
void SCIStartTransmit(char cData)
{
while (!SCI1SR1_TDRE)
{ // ensure Tx data buffer empty }
SCI1DRL = cData; // load data to data register
while (!SCI1SR1_TC) { // wait for Tx complete }
}
[此贴子已经被作者于2005-11-7 10:00:27编辑过] |