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.

TM4C129XNCZAD: How to Send and Receive the data using UART in TM4C129XNZAD

Part Number: TM4C129XNCZAD

Hello,

I am working on Tm4c129xnzad, I am using UARTSend function for sending or entering some character at serial terminal. Now my question, to receive the data like I am entering some character in serial terminal, I want to read that data so what is the function I want to use , please tell me which function can read the data. Anyone plz help me on this. 

Thanks .

  • Hi,

      In the other post you created I gave you several examples. Why don't you take a look at these examples? The function to read the UART will be UARTCharGet or UARTCharGetNonBlocking.  See below snippet of code in the uart_echo.c file. This example is to echo what is received on RX to TX. Therefore, you see that you call UARTCharGetNonBlocking to receive the data and then send the same data out on TX using UARTCharPutNonBlocking. 

    //
    // Loop while there are characters in the receive FIFO.
    //
    while(MAP_UARTCharsAvail(UART0_BASE))
    {
    //
    // Read the next character from the UART and write it back to the UART.
    //
    MAP_UARTCharPutNonBlocking(UART0_BASE, MAP_UARTCharGetNonBlocking(UART0_BASE));

    Also refer to the peripheral driver library user's guide https://www.ti.com/lit/ug/spmu298e/spmu298e.pdf for details on all TivaWare APIs.