<?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: setting BD rate upper than 115200 for uart in lpc812 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561893#M16372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear David,&lt;/P&gt;&lt;P&gt;Really thanks for your great help,&lt;/P&gt;&lt;P&gt;is there any calculator tools which be able to calculate register values &amp;amp; error for custom baud rates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jul 2016 03:57:31 GMT</pubDate>
    <dc:creator>mahmoudhosseini</dc:creator>
    <dc:date>2016-07-13T03:57:31Z</dc:date>
    <item>
      <title>setting BD rate upper than 115200 for uart in lpc812</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561891#M16370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using below LPCOPEN based codes for configging UART on my LPC812.&lt;/P&gt;&lt;P&gt;for normal baud rate below 115200(most usual) it works fine,but when i set a custom baud rate like(115200 *2) or&lt;/P&gt;&lt;P&gt;(115200 *n) it does not work either.whats problem?&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;&amp;nbsp; //---UART Initialing---------------------------------&lt;/P&gt;&lt;P&gt;Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Divided by 1 */&lt;/P&gt;&lt;P&gt;Chip_Clock_SetUARTClockDiv(1);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Connect the U0_TXD_O and U0_RXD_I signals to port pins(P0.4, P0.0) */&lt;/P&gt;&lt;P&gt;Chip_SWM_DisableFixedPin(4);&lt;/P&gt;&lt;P&gt;Chip_SWM_MovablePinAssign(SWM_U1_TXD_O, 4);&lt;/P&gt;&lt;P&gt;Chip_SWM_MovablePinAssign(SWM_U1_RXD_I, 0);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Disable the clock to the Switch Matrix to save power */&lt;/P&gt;&lt;P&gt;//Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);&lt;/P&gt;&lt;P&gt;Chip_UART_Init(LPC_USART1);&lt;/P&gt;&lt;P&gt;Chip_UART_ConfigData(LPC_USART1, UART_CFG_DATALEN_8 | UART_CFG_PARITY_NONE | UART_CFG_STOPLEN_1);&lt;/P&gt;&lt;P&gt;Chip_Clock_SetUSARTNBaseClockRate((115200 * 16), true);&lt;/P&gt;&lt;P&gt;Chip_UART_SetBaud(LPC_USART1, 115200);&lt;/P&gt;&lt;P&gt;Chip_UART_Enable(LPC_USART1);&lt;/P&gt;&lt;P&gt;Chip_UART_TXEnable(LPC_USART1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 08:16:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561891#M16370</guid>
      <dc:creator>mahmoudhosseini</dc:creator>
      <dc:date>2016-07-12T08:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: setting BD rate upper than 115200 for uart in lpc812</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561892#M16371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahmond,&lt;/P&gt;&lt;P&gt;I am not expert but a quick testing using LPCOpen for LPC812MAX board and Example_UART0_Terminal example shows the core clock is set to 24MHz and default baud is 9600.&lt;/P&gt;&lt;P&gt;Changing the BRG value from 155 to 12 allowed the baud to work successfully at 115200.&lt;/P&gt;&lt;P&gt;But trying to double it to 230400 baud did not work (I set BRG=5).&amp;nbsp; But I believe the reason is too much error as the calculated BRG was 5.5 and rounding it to nearest integer didn't work.&amp;nbsp; However increasing to 249600 baud had calculated BRG ~5 and that worked fine for me using Putty as my PC terminal utility.&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Configure the USART0 baud rate generator&lt;/P&gt;&lt;P&gt;&amp;nbsp; LPC_USART0-&amp;gt;BRG = 5; //DES was 155;&amp;nbsp; 155 for 9600 baud and 12 for 115200 baud, 10 for 134400 baud&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DES 9 for 153600, 7 for 192000 baud, 6 for 211200 baud, 5(5.5 calculated) for 230400 baud...NOT WORKING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DES 5 for 249600 baud....WORKING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DES Summary:&amp;nbsp; Too much error in UART clock config when core at 24MHz to achieve 2*115200 baud.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 16:17:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561892#M16371</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-07-12T16:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: setting BD rate upper than 115200 for uart in lpc812</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561893#M16372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear David,&lt;/P&gt;&lt;P&gt;Really thanks for your great help,&lt;/P&gt;&lt;P&gt;is there any calculator tools which be able to calculate register values &amp;amp; error for custom baud rates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 03:57:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561893#M16372</guid>
      <dc:creator>mahmoudhosseini</dc:creator>
      <dc:date>2016-07-13T03:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: setting BD rate upper than 115200 for uart in lpc812</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561894#M16373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahmoud, &lt;/P&gt;&lt;P&gt;You are welcome.&lt;/P&gt;&lt;P&gt;Sorry there is no calculator that I know of.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 20:11:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561894#M16373</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-07-13T20:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: setting BD rate upper than 115200 for uart in lpc812</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561895#M16374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see two options to get to higher baud rates:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The UART fractional rate generator in the SYSCON block supplies the input clock globally to all UART's by dividing down from the main clock. Assuming a main clock of 24 MHz, the total prescaler ratio for a baud rate of 230400 is 24M/(230k4*16)=6.51. This can be distributed over the integer prescaler (global), the fractional generator (global), and the integer baud rate generator (per UART).&lt;BR /&gt;As an example, set UARTCLKDIV=2 (divide by 2), USART0.BRG=2 (divide by 3). The fractional divider must be set to 6.51/6=1.0851, which is achieved by UARTFRGDIV=255 (DIV=256), UARTFRGMULT=22.&lt;BR /&gt;The resulting baud rate is 230216 (-0.08%)&lt;/LI&gt;&lt;LI&gt;In general main clock is not equal to CPU clock. While the CPU clock is limited to 30 MHz, the main clock can be as high as 100 MHz. Example: Set the PLL to provide a main clock of 48 MHz, then divide by 2 (SYSAHBCLKDIV) for a CPU clock of 24 MHz. Now the 48 MHz can be divided by 13 to get an accurate 230400 baud rate. Doesn't require the fractional generator in this case.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2016 09:25:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/setting-BD-rate-upper-than-115200-for-uart-in-lpc812/m-p/561895#M16374</guid>
      <dc:creator>rolfmeeser</dc:creator>
      <dc:date>2016-07-14T09:25:23Z</dc:date>
    </item>
  </channel>
</rss>

