<?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>LPC Microcontrollers中的主题 Changing baud rate of LPC 4370</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Changing-baud-rate-of-LPC-4370/m-p/807639#M32424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know how to change the UART's baudrate for an LPC4370 microcontroller. I am using&amp;nbsp;an&amp;nbsp;example program from LPCExpresso to change the baudrate, from the board.c file. It has a function as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chip_UART_SetBaud(DEBUG_UART, 115200);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also included the function definition below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint32_t Chip_UART_SetBaud(LPC_USART_T *pUART, uint32_t baudrate)&lt;BR /&gt;{&lt;BR /&gt; uint32_t div, divh, divl, clkin;&lt;/P&gt;&lt;P&gt;/* Determine UART clock in rate without FDR */&lt;BR /&gt; clkin = Chip_Clock_GetRate(Chip_UART_GetClockIndex(pUART));&lt;BR /&gt; div = clkin / (baudrate * 16);&lt;/P&gt;&lt;P&gt;/* High and low halves of the divider */&lt;BR /&gt; divh = div / 256;&lt;BR /&gt; divl = div - (divh * 256);&lt;/P&gt;&lt;P&gt;Chip_UART_EnableDivisorAccess(pUART);&lt;BR /&gt; Chip_UART_SetDivisorLatches(pUART, divl, divh);&lt;BR /&gt; Chip_UART_DisableDivisorAccess(pUART);&lt;/P&gt;&lt;P&gt;/* Fractional FDR alreadt setup for 1 in UART init */&lt;/P&gt;&lt;P&gt;return clkin / div;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As seen, the baud rate is set by dividing the clkin by div. I am trying to achieve a baud rate higher than 115200, and it doesn't really work as it does for transferring data serially to an Arduino, as it does at 115200. I am new to using the microcontroller, any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2018 02:24:11 GMT</pubDate>
    <dc:creator>vxs187</dc:creator>
    <dc:date>2018-11-28T02:24:11Z</dc:date>
    <item>
      <title>Changing baud rate of LPC 4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Changing-baud-rate-of-LPC-4370/m-p/807639#M32424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know how to change the UART's baudrate for an LPC4370 microcontroller. I am using&amp;nbsp;an&amp;nbsp;example program from LPCExpresso to change the baudrate, from the board.c file. It has a function as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chip_UART_SetBaud(DEBUG_UART, 115200);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also included the function definition below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint32_t Chip_UART_SetBaud(LPC_USART_T *pUART, uint32_t baudrate)&lt;BR /&gt;{&lt;BR /&gt; uint32_t div, divh, divl, clkin;&lt;/P&gt;&lt;P&gt;/* Determine UART clock in rate without FDR */&lt;BR /&gt; clkin = Chip_Clock_GetRate(Chip_UART_GetClockIndex(pUART));&lt;BR /&gt; div = clkin / (baudrate * 16);&lt;/P&gt;&lt;P&gt;/* High and low halves of the divider */&lt;BR /&gt; divh = div / 256;&lt;BR /&gt; divl = div - (divh * 256);&lt;/P&gt;&lt;P&gt;Chip_UART_EnableDivisorAccess(pUART);&lt;BR /&gt; Chip_UART_SetDivisorLatches(pUART, divl, divh);&lt;BR /&gt; Chip_UART_DisableDivisorAccess(pUART);&lt;/P&gt;&lt;P&gt;/* Fractional FDR alreadt setup for 1 in UART init */&lt;/P&gt;&lt;P&gt;return clkin / div;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As seen, the baud rate is set by dividing the clkin by div. I am trying to achieve a baud rate higher than 115200, and it doesn't really work as it does for transferring data serially to an Arduino, as it does at 115200. I am new to using the microcontroller, any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 02:24:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Changing-baud-rate-of-LPC-4370/m-p/807639#M32424</guid>
      <dc:creator>vxs187</dc:creator>
      <dc:date>2018-11-28T02:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing baud rate of LPC 4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Changing-baud-rate-of-LPC-4370/m-p/807640#M32425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Visweshwar Srinivasan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the formula that is shown in the user guide section 40.6.12 to see which is the maximum baud rate you can reach depending on the peripheral clock.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/78596iE0BE51B7BE5A02FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2018 22:20:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Changing-baud-rate-of-LPC-4370/m-p/807640#M32425</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-12-03T22:20:13Z</dc:date>
    </item>
  </channel>
</rss>

