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.

28335 scic接收数据只能接收第一位数据是怎么回事求大神指导

void scic_echoback_init()
{
    // Note: Clocks were turned on to the SCIA peripheral
    // in the InitSysCtrl() function

  ScicRegs.SCICCR.all =0x0007;   // 1 stop bit,  No loopback
                                   // No parity,8 char bits,
                                   // async mode, idle-line protocol
 ScicRegs.SCICTL1.all =0x0003;  // enable TX, RX, internal SCICLK,
                                   // Disable RX ERR, SLEEP, TXWAKE
 ScicRegs.SCICTL2.all =0x0003;
 ScicRegs.SCICTL2.bit.TXINTENA = 1;
 ScicRegs.SCICTL2.bit.RXBKINTENA =1;
 #if (CPU_FRQ_150MHZ)
       ScicRegs.SCIHBAUD    =0x0001;  // 9600 baud @LSPCLK = 37.5MHz.
       ScicRegs.SCILBAUD    =0x00E7;
 #endif
 #if (CPU_FRQ_100MHZ)
      ScicRegs.SCIHBAUD    =0x0001;  // 9600 baud @LSPCLK = 20MHz.
      ScicRegs.SCILBAUD    =0x0044;
 #endif
 ScicRegs.SCICTL1.all =0x0023;  // Relinquish SCI from Reset
}

void scic_fifo_init()
{
    ScicRegs.SCIFFTX.all=0x8000;

}

void ReceiveData()
{
  while(ScicRegs.SCIRXST.bit.RXRDY ==1)  // wait for XRDY =1 for empty state
  {

   ReceivedChar = ScicRegs.SCIRXBUF.all;

}

  • SCI初始化配置有问题。void SCIC_FIFO_Init()函数对SCIFFTX寄存器的配置有问题,也没有对SCIFFRX进行配置。

    建议拿个controlsuit的SCI的例程拿出来看,结合datasheet的文档来做配置。