This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于SCI的疑问

对串口使用有些疑问 请教大家一下

数据手册中的描述是:

Data bits to be transmitted are written to SCITXBUF. These bits must be rightjustified because the
leftmost bits are ignored for characters less than eight bits long. The transfer of data from this register to
the TXSHF transmitter shift register sets the TXRDY flag (SCICTL2.7), indicating that SCITXBUF is ready
to receive another set of data.

在没有使能串口发送硬件FIFO的情况下,程序中将要发送的数据写入SCITXBUF前,应该是要判断一下TXRDY 标志位的状态吧,如手册中描述的那样;


但是如果使能了硬件发送FIFO,写数据到SCITXBUF前还需要判断一下TXRDY 标志位的状态吗?


看了个中断FIFO发送的程序,写SCITXBUF前没有检测TXRDY 的状态,就是循环写的

interrupt void sciaTxFifoIsr(void)
{
    Uint16 i;
    for(i=0; i< 8; i++)
    {
        SciaRegs.SCITXBUF=sdataA[i];     // Send data
    }

    for(i=0; i< 8; i++)                 //Increment send data for next cycle
    {
        sdataA[i] = (sdataA[i]+1) & 0x00FF;
    }

    SciaRegs.SCIFFTX.bit.TXFFINTCLR=1;    // Clear SCI Interrupt flag
    PieCtrlRegs.PIEACK.all|=0x100;      // Issue PIE ACK
}


是使能FIFO以后,写入到SCITXBUF中的数据会被立即搬移到FIFO中,其搬移时间很快,不用判断TXRDY 的状态了吗?