Hi C2K experts,
I am trying to use auto baud rate detection (F280049), however,
the program is stuck at below statement, even I had sent 'a' ('A').
while(SciaRegs.SCIFFCT.bit.ABD != 1) {}
I am sure the RX, TX pins are correct. The host baud rate is 9600.
Here is my code:
void SCIA_AutobaudLock(void)
{
Uint16 byteData;
SciaRegs.SCICCR.all = 0x0007;
SciaRegs.SCICTL1.all = 0x0003;
SciaRegs.SCICTL2.all = 0x0000;
SciaRegs.SCICTL1.all = 0x0023;
// Reset
SciaRegs.SCIFFTX.bit.SCIRST = 1;
//----- SCI Reset -----//
SciaRegs.SCICTL1.bit.SWRESET = 0;
SciaRegs.SCICTL1.bit.SWRESET = 1;
//---------------------//
// Must prime baud register with >= 1
SciaRegs.SCIHBAUD.all = 0x0000;
SciaRegs.SCILBAUD.all = 0x0001;
// Prepare for autobaud detection
// Set the CDC bit to enable autobaud detection
// and clear the ABD bit
SciaRegs.SCIFFCT.bit.CDC = 1;
SciaRegs.SCIFFCT.bit.ABDCLR = 1;
// Wait until we correctly read an
// 'A' or 'a' and lock
while(SciaRegs.SCIFFCT.bit.ABD != 1) {}
// After autobaud lock, clear the ABD and CDC bits
SciaRegs.SCIFFCT.bit.ABDCLR = 1;
SciaRegs.SCIFFCT.bit.CDC = 0;
while(SciaRegs.SCIRXST.bit.RXRDY != 1) { }
byteData = (Uint16)SciaRegs.SCIRXBUF.bit.SAR; //SciaRegs.SCIRXBUF.bit.RXDT;
SciaRegs.SCITXBUF.bit.TXDT = byteData;
return;
}
May I have your comment about this?
Thanks,




