<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I change baud rate on the fly on LPC11U68 using LPCXpresso? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715968#M28935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rens,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user manual says that you need to be sure that you are not receiving any data because you will disable the UART so you won't be able to receive or transmit any data until you enable the UART again once you change the baudrate. So the step 1 (Make sure the USART is not currently sending or receiving data) is just to be sure that you won't loss any information. Here you have two options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Call the set baudrate function when you know you are not expecting any data from the UART.&lt;/LI&gt;&lt;LI&gt;Check for the values&amp;nbsp; of RXIDLE and TXIDLE in the STAT Register of the UART (page 206 of user manual).&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The routine you Chip_UARTN_SetBaud doesn't disable the UART, because this function was made planning that you will use it at the beginning of the program when the UART is disable. However, you can make the change with this function too, you just have to disable the USART then call the function and finally enable it again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here's the code:&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/*Function to change the baudrate of the UART*/&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;setupBaudrate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint32_t baudrate&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Deactivate the UART*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;CFG &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFFFE&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Setting the new baudrate*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="token function"&gt;Chip_UARTN_SetBaud&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_USART1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; baudrate&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Enable the UART again*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;CFG &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0x1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;/*Check if the USART is not transmitting or receiving data*/&lt;/SPAN&gt; 
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;STAT &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;STAT &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Call the function to set a new baudrate*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="token function"&gt;setupBaudrate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9600&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Test that the new baudrate was set correctly*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="token function"&gt;putLineUART&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"BAUDRATE CHANGED 9600\r\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any more doubts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Feb 2018 18:40:40 GMT</pubDate>
    <dc:creator>victorjimenez</dc:creator>
    <dc:date>2018-02-16T18:40:40Z</dc:date>
    <item>
      <title>How can I change baud rate on the fly on LPC11U68 using LPCXpresso?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715965#M28932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to change the baudrate on UARTN for a moment and back again to allow to set the proper baudrate on the module that is connected to it.&lt;/P&gt;&lt;P&gt;I cannot figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Rens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Feb 2018 17:39:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715965#M28932</guid>
      <dc:creator>renskessener</dc:creator>
      <dc:date>2018-02-04T17:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change baud rate on the fly on LPC11U68 using LPCXpresso?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715966#M28933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which UART are you using? Please notice that you need to use UART1, UART2, UART3 or UART4 in order to change the baudrate on the go.&lt;/P&gt;&lt;P&gt;In the corresponding user manual of the LPC (&lt;A href="https://www.nxp.com/docs/en/user-guide/UM10732.pdf"&gt;UM10732&lt;/A&gt;) page 212 section &lt;STRONG&gt;Remark&lt;/STRONG&gt;&amp;nbsp;you will find the steps to change the baudrate on the go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of a function to re declare the baudrate:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void setupBaudrate(uint32_t baudrate)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;LPC_USART1-&amp;gt;CFG = 0x00;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;UART_CONFIG_T cfg =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0, /* U_PCLK frequency in Hz */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;baudrate, /* Baud Rate in Hz */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1, /* 8N1 */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0, /* Asynchronous Mode */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NO_ERR_EN /* Enable No Errors */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;cfg.sys_clk_in_hz = Chip_Clock_GetSystemClockRate();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Initialize the UART with the configuration parameters */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;(void)LPC_UARTND_API-&amp;gt;uart_init(uartHandle, &amp;amp;cfg);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this function along with the example periph_uart_n_rom_polling provided in the LPCOpen and it worked correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any more doubts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2018 17:30:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715966#M28933</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-02-13T17:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change baud rate on the fly on LPC11U68 using LPCXpresso?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715967#M28934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor,&lt;BR /&gt; &lt;BR /&gt; Thanks for your reply.&lt;BR /&gt; &lt;BR /&gt; I had (still have) the flu, so everything goes a bit slow.&lt;BR /&gt; &lt;BR /&gt; I still have some questions:&lt;BR /&gt; &lt;BR /&gt; The remark on page 212 of the user manual says:&lt;BR /&gt; Remark: If software needs to change the baud rate, the following sequence should be&lt;BR /&gt; used: 1) Make sure the USART is not currently sending or receiving data. 2) Disable the&lt;BR /&gt; USART by writing a 0 to the Enable bit (0 may be written to the entire registers). 3) Write&lt;BR /&gt; the new BRGVAL. 4) Write to the CFG register to set the Enable bit to 1.&lt;BR /&gt; &lt;BR /&gt; How can you be sure, in a "living" system that the UART is not receiving data, as data arrives asynchrousnously?&lt;BR /&gt; Would disable UART be sufficient? &lt;BR /&gt; &lt;BR /&gt; I also found the routine:&lt;BR /&gt; &lt;BR /&gt; void Chip_UARTN_SetBaud(LPC_USARTN_T *pUART, uint32_t baudrate)&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t baudRateGenerator;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; baudRateGenerator = Chip_Clock_GetUSARTNBaseClockRate() / (16 * baudrate);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; pUART-&amp;gt;BRG = baudRateGenerator - 1;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* baud rate */&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; in uart_n_11u6x.c.&lt;BR /&gt; &lt;BR /&gt; Shouldn't this do the job as well?&lt;BR /&gt; Why doesn't this routine NOT disable the UART? Any idea?&lt;BR /&gt; &lt;BR /&gt; I have to adapt the lpcopen example to my board to test it, but I am confident that,&lt;BR /&gt; except the "active" receiver, it will work.&lt;BR /&gt; &lt;BR /&gt; Thanks again for your reply.&lt;BR /&gt; &lt;BR /&gt; Best regards, Rens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 21:31:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715967#M28934</guid>
      <dc:creator>renskessener</dc:creator>
      <dc:date>2018-02-15T21:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change baud rate on the fly on LPC11U68 using LPCXpresso?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715968#M28935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rens,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user manual says that you need to be sure that you are not receiving any data because you will disable the UART so you won't be able to receive or transmit any data until you enable the UART again once you change the baudrate. So the step 1 (Make sure the USART is not currently sending or receiving data) is just to be sure that you won't loss any information. Here you have two options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Call the set baudrate function when you know you are not expecting any data from the UART.&lt;/LI&gt;&lt;LI&gt;Check for the values&amp;nbsp; of RXIDLE and TXIDLE in the STAT Register of the UART (page 206 of user manual).&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The routine you Chip_UARTN_SetBaud doesn't disable the UART, because this function was made planning that you will use it at the beginning of the program when the UART is disable. However, you can make the change with this function too, you just have to disable the USART then call the function and finally enable it again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here's the code:&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/*Function to change the baudrate of the UART*/&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;setupBaudrate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint32_t baudrate&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Deactivate the UART*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;CFG &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFFFE&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Setting the new baudrate*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="token function"&gt;Chip_UARTN_SetBaud&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_USART1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; baudrate&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Enable the UART again*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;CFG &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0x1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;/*Check if the USART is not transmitting or receiving data*/&lt;/SPAN&gt; 
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;STAT &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_USART1&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;STAT &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Call the function to set a new baudrate*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="token function"&gt;setupBaudrate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9600&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;/*Test that the new baudrate was set correctly*/&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="token function"&gt;putLineUART&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"BAUDRATE CHANGED 9600\r\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any more doubts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 18:40:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-I-change-baud-rate-on-the-fly-on-LPC11U68-using/m-p/715968#M28935</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-02-16T18:40:40Z</dc:date>
    </item>
  </channel>
</rss>

