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: How to Change the baud rate runtime with out doing reboot.

Part Number: TM4C1294NCPDT

Hi,

I am not able to reconfigure the UART baud rate once it is configured. My requirement is to change the baud rate as per the user command without doing the reboot. When the system power up it initialize the UART to default baud rate. I want to reconfigure the baud-rate, based on the user command but I am not able to reconfigure it. I am using CCS 10.1 for development and SDK is "tirtos_tivac_2_16_00_08". Before reconfiguring the UART, I called the "UART_close" API then I am calling "UARTConfigure" API which again calls "UART_open" API. I am getting the handle after calling the "UART_open" API but I am not able to communicate on the new baudrate. If I save that baud rate and do the system reboot then it is working. Please let me know the steps to change the baud rate runtime without a reboot.

  • Consider using the TivaWare function UARTBusy() to make sure the UART is not currently transmitting, then call UARTDisable(), UARTConfigGetExpClk(), change the baudrate value and then call UARTConfigSetExpClk() and UARTEnable(). Of course any characters that were being received at that time will be corrupt.

  • Thanks, Bob for your response. I am calling the function "UARTTiva_close" from the UARTTIVA.c file which will do UARTDisable. Then I am calling the function "UARTTiva_open" from the same file. This function is calling "UARTEnable" first and then "UARTConfigSetExpClk". So the sequence you suggested is already there. But still, it is not changing the baud rate. Note:-  "UARTBusy" and "UARTConfigGetExpClk" are not called by "UARTTiva_close" or "UARTTiva_open". Please give your comments on this.

  • Did you try running the TivaWare functions outside of the UARTTiva_xxxx functions once you open the port and then want to change the buadrate?