Part Number: TMS320F28379D
hello all,
I am trying to Chang sci baud rate in run time. I used the following function to initialize sci buffer and set scib baud rate.
I tried use the same function to reset baud rate to other number in run time. It seems it can succeed several time then the uart will never receive anything from PC.
Any suggestion or help will be appreciated. Thanks
scib_ini(uint16_t sciLbaud ){
ScibRegs.SCIFFTX.all = 0xE040;
ScibRegs.SCIFFRX.all = 0x2044;
ScibRegs.SCIFFCT.all = 0x0;
////--------------------
ScibRegs.SCICCR.all =0x0007;
// enable TX, RX, internal SCICLK, Disable RX ERR, SLEEP, TXWAKE
//
ScibRegs.SCICTL1.all =0x0003;
ScibRegs.SCICTL2.bit.TXINTENA =1;
// ScibRegs.SCICTL2.bit.RXBKINTENA =1;
// 115200 baud @LSPCLK = 22.5MHz (90 MHz SYSCLK)
// @LSPCLK = 50 MHz (200 MHz SYSCLK) HBAUD = 0x02 and LBAUD = 0x8B.
//
ScibRegs.SCIHBAUD.all =0x0000;
ScibRegs.SCILBAUD.all = sciLbaud; // // 53 for 115200
ScibRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset
}