Hi Jean-Marc,
I'm working with the TMS570 HDK and the LS3137 MCU, with VCLK configured to use 60 MHz. For some reason the while() loop of the following code never end.
If I omit the while() loop, then the IDLE bit is set and I can't TX nor RX.
Any clue?
void tagRs232::Init()
{
SCI2GCR0 = 0x00000001; // bring SCI2 out of reset to configure SCI registers
SCI2GCR1 = 0x03020022; // TX/RX enabled, continue, ready, internal SCICLK, asynchronous timing mode, 1 stop bit, non parity
SCI2SETINT = 0x00000300; // enable TX/RX interrupts
SCI2FORMAT = 0x00000007; // SCI mode character length is 8 bits
SCI2BRS = 0x00000040; // baudrate is 57600 bps
SCI2PIO0 = 0x00000006; // SCIRX and SCITX as SCI function pins
SCI2GCR1 = 0x030200A2; // set SW_nRST=1 to enable SCI
while ((SCI2FLR & 0x4) == 0x4) // wait for the IDLE bit to be cleared
continue;
}
Thanks!