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.

Uart usage in Uart_Echo



Hi, I have started playing with my Launchpad and the Uart_Echo example .I have at the top of main declared

uint8_t *buff = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

 I have modified the UARTSend line to the following: 

UARTSend(buff, 26);

 

I am however only getting up to Q received on my PC terminal. That's 17 characters, one more than 16 which may be a pointer to what I need to do next.

Is there something I need to change or add to continue sending characters??

 

  • Hi Lee,

         I think that is because, there is no more space in the transmit FIFO. Transmit FIFO is limited to 16 bytes. You can verify this by putting a breakpoint at "else" part of UARTCharPutNonBlocking().Then run the program in debug mode while viewing the characters printed out at your serial console.

    -kel

  • Hi Kel,

     

    I'm not sure how to access the ROM_UARTCharPutNonBlocking() function. I did manage to get things working by changing to

    ROM_UARTCharPut which works ok but this doesn't show me how to use the FIFO properly.

  • Hi Lee,

    Lee Noack said:
    I'm not sure how to access the ROM_UARTCharPutNonBlocking() function

    You need to add uart.c to your project, like this below using Keil Uvision.

    Lee Noack said:
    but this doesn't show me how to use the FIFO properly

    Search this forum and Stellaris forum regarding UART FIFO.

    -kel

  • Your PC terminal may be too slow or does not have enough memory. Certain software company is very Innovative in Advanced Technology and requires very fast CPU and huge memory.

  • The cause of the problem is UARTCharPutNonBlocking(), which is called in UARTSend(). See partial description below. 

    //! This function writes the character \e ucData to the transmit FIFO for the
    //! specified port. This function does not block, so if there is no space
    //! available, then a \b false is returned and the application must retry the
    //! function later.

    -kel

  • Thanks Kel. Looping through the function it seems to return false every second iteration. Seems to print out the entire string though if longer than 16 with the debugger but not running "from the board". As mentioned earlier the UARTCharPut() function seems ok however it was a pain to work out how many characters I wanted to send each time so I wrote a more standard Puts() function.

    void UARTPuts(const uint8_t *pui8Buffer)

     {  //Loop while not Null  

    while(*pui8Buffer != 0)

      {  

    ROM_UARTCharPut(UART0_BASE, *pui8Buffer++);  }

     }

    I'll do some more searching on use of the FIFO and UART

     

  • Might you "Verify Answer", any of my replies that  helps solve your problem. Thanks.