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.

TM4C123xx UART Stdio

Hi , 

I have few beginners doubt with UART Stdio libraries ..

1) When the function is being called ; (UARTprintf , UARTgetc) I dont see any argument pointing to the UART port to be used . CAn it be used only when one port is active ? If not how to manage multiple UARTS ? (Any descriptive link or example would be a great help)

2) Are there any good interrupt based UART source codes which I can see and implement ? (for one of my hobby projects . The polling method with UART Stdio works very nicely)

Regards

itzjis

  • Hello Itzjis,

    The API to call is UARTStdioConfig which has 3 arguments. The first one is the UART number, second argument is baud rate and last is the system clock frequency. Please check the example "interrupts" on how to use the API and configure the IO for UART. Please do note that the first argument can only take the values 0 to 2.

    The udma_demo is a good example for interrupt/dma based mechanism

    Regards
    Amit
  • Hi Amit ,

    Thanks for the quick response . The UARTStdioConfig part I could see . Suppose I initialize UART 0,1 and 2 in the program start . Then Suppose , I want to send some data to UART 1 , some to UART 0 , while reading from data UART 2 . How can I do that ? How do I decide which UART gets the data when UARTprintf , UARTgetc .. etc are called in that case ?

    Regards
    jis
  • Hello Jis

    That is not possible to use UARTprintf. Rather than that I would suggest using the UARTCharGet and UARTCharPut for individual UART's

    Regards
    Amit