问题在“F28027串口FIFO收发中断问题”有描述。
写到flash后,重新上电,串口接收报错,导致无法接收数据,发送正常。
报错:寄存器SCIRXST-RX ERROR 1,寄存器SCIRXBUF-SCIFFFE/SCIFFPE 1
按一下复位按钮,接收就正常了。这是啥情况哦??有兄弟碰到过没有?
串口初始化代码:
void InitSci(void)
{
// Initialize SCI-A:
SciaRegs.SCICCR.all = 0x0007; // 1 stop bit, No loopback
// No parity,8 char bits,
// async mode, idle-line protocol
SciaRegs.SCICTL1.all = 0x0003; // enable TX, RX, internal SCICLK,
// Disable RX ERR, SLEEP, TXWAKE
// Disable RXRDY/BRKDT/TXRDY interrupt
SciaRegs.SCICTL2.bit.TXINTENA = 0;
SciaRegs.SCICTL2.bit.RXBKINTENA = 0;
SciaRegs.SCIHBAUD = 0x0000;
SciaRegs.SCILBAUD = SCI_PRD; // 38400
// FIFO enable configure
SciaRegs.SCIFFTX.all = 0xC020;
SciaRegs.SCIFFRX.all = 0x0021;
// Disable FIFO interrupt
SciaRegs.SCIFFTX.bit.TXFFIENA = 0;
SciaRegs.SCIFFRX.bit.RXFFIENA = 0;
SciaRegs.SCIFFCT.all = 0x00;
SciaRegs.SCICTL1.bit.SWRESET = 1; // Relinquish SCI from Reset
SciaRegs.SCIFFTX.bit.TXFIFOXRESET = 1;
SciaRegs.SCIFFRX.bit.RXFIFORESET = 1;
} |