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.

TM4C1294NCPDT: UART

Part Number: TM4C1294NCPDT

Hi,

I am using ti\TivaWare_C_Series-2.1.4.178\examples\boards\dk-tm4c129x\uart_echo to test uarts.

I have enabled uart0 & uart1, clock running at 120MHz.

Data Rcvd on uart0 Txd on uart1 and vice versa. (Exchanging In Interrupt handler only).

Problem statement:

Both uarts are connected to PC. With Baud 9600 configured, I am sending 50k of data file from one uart to another. If powered on and data sent everything works fine.

But when data is transmitting if I power down the device and power on it, I will be getting junk on other side of uart. After complete 50k data has transmitted and i continue sending data(limited data) rcvd data will be proper only.

Please let me know how I can solve this issue.

Regards,

Dileep

  • Dileep,
    While the description is a bit confusing, it appears to me that you should clear your RX uart FIFO right after initializing/configuring the peripheral (valid for both uarts). Only after that should you start transmitting/receiving data on your main loop.
    Bruno
  • This can be a downside of UART based communications. They rely on pauses between the characters to determine the start position and if they are not they can lose sync. This is self correcting but it can take a while. It's one of the reasons (only one) that serial file transfer protocols use packets and checksums.

    This assumes you have no pauses between characters if there is one then the process should correct at that point. This can also be improved by increasing the number of stop bits.

    Robert
  • @ Robert,

    Along w/"increase in stop bits" might not the "periodic" use of "break" offer an advantage? (same "pause" - yet no "added bit penalty" for each every char transferred.)
  • Well, break characters are generally reserved for error signalling and some programs or connections don't respond well to them, but an explicit pause could do it.

    That pause is also what I was suggesting would happen naturally when using a serial file transfer protocol (XModem, kermit etc...) You do add a bit of overhead but the result is quite a bit more robust. And there are plenty of available protocols to choose from with varying throughput, overhead and other characteristics.

    Robert