<?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: UART Txing Junk bytes in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231150#M5000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It worked with the UART4 without any glitch. But with UART0 it doesnt work as expected. I think it has some baud issues.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Chandra &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Nov 2013 11:11:13 GMT</pubDate>
    <dc:creator>chandrasekhar</dc:creator>
    <dc:date>2013-11-27T11:11:13Z</dc:date>
    <item>
      <title>UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231147#M4997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am using K21 controller(Baremetal). When I try to write some bytes to UART0, it is writing junk bytes. I tapped the data and checked. But for the second time it is writing complete data correctly.&lt;/P&gt;&lt;P&gt;Can anyone please help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 09:33:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231147#M4997</guid>
      <dc:creator>chandrasekhar</dc:creator>
      <dc:date>2013-11-27T09:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231148#M4998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Chandra&lt;/P&gt;&lt;P&gt;Do you use interrupt method or polling flag method to send data? It is better to share your code for my checking. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 09:37:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231148#M4998</guid>
      <dc:creator>Paul_Tian</dc:creator>
      <dc:date>2013-11-27T09:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231149#M4999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zhe Tian&lt;/P&gt;&lt;P&gt;I am using polling based only, I am checking only this condition&lt;/P&gt;&lt;P&gt;while(!(UART_S1_REG(UART0_BASE_PTR) &amp;amp; UART_S1_TDRE_MASK));.&lt;/P&gt;&lt;P&gt;Attached is my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meanwhile I try with other UART and check whether it givesthe same behaviour or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 09:41:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231149#M4999</guid>
      <dc:creator>chandrasekhar</dc:creator>
      <dc:date>2013-11-27T09:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231150#M5000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It worked with the UART4 without any glitch. But with UART0 it doesnt work as expected. I think it has some baud issues.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Chandra &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 11:11:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231150#M5000</guid>
      <dc:creator>chandrasekhar</dc:creator>
      <dc:date>2013-11-27T11:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231151#M5001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Chandra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UART0 and UART1 are clocked from the core clock, the remaining UARTs are clocked on the bus clock. Would you please check if this factor cause your problem? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2013 00:37:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231151#M5001</guid>
      <dc:creator>Paul_Tian</dc:creator>
      <dc:date>2013-11-28T00:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231152#M5002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zhe TIan,&lt;/P&gt;&lt;P&gt;Yes I have checked the clock settings and I am giving it right. UART0 is giving problem for the first time only. I have already attached the code.&lt;/P&gt;&lt;P&gt;It is behaving the same way in MQX also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandrasekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2013 05:30:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231152#M5002</guid>
      <dc:creator>chandrasekhar</dc:creator>
      <dc:date>2013-11-28T05:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231153#M5003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know that this is an older post but I ran into a similar issue with UART5 on a k64 TWR board recently.&amp;nbsp; I started out testing at 2400 baud and periodically received junk characters.&amp;nbsp; I cycled power to the board and it sometimes worked correctly and other times not.&amp;nbsp; I was sending 'A' through 'G' characters (0x41 through 0x47).&amp;nbsp; The junk characters received were the actual characters, but not shifted correctly.&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'A' = 01000001 came across as 00001011,&lt;/P&gt;&lt;P&gt;'B' = 01000010 came across as 00010011,&lt;/P&gt;&lt;P&gt;'C' = 01000011 came across as 00011011, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I changed the baud rate up to 9600 or higher (I went all the way up to 600,000 baud) it worked perfectly.&amp;nbsp; I suspect that it was just a timing issue in the way I set up the baud rate.&amp;nbsp; If I had used Processor Expert I could have fine tuned the Baud Rate and it would have worked better at 2400 baud.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was using some example code that I found on a forum somewhere else. (pasted below)&amp;nbsp; I modified it to use the UART5_RX_TX_IRQn interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John Baker&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;void UART_Init ( UART_Type *pUART ){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint16_t u16Sbr, u16Brfa;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t u8Temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t u32SysClk = 120000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t u32Baud = UART_BAUDRATE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Enable the clock to the selected PORT */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTE_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the pins multiplexer to UART RX/TX mode */&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTE-&amp;gt;PCR[8] = PORT_PCR_MUX( 3 );&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTE-&amp;gt;PCR[9] = PORT_PCR_MUX( 3 );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Enable the clock to the selected UART */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC1 |= SIM_SCGC1_UART5_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Make sure that the transmitter and receiver are disabled while we&lt;/P&gt;&lt;P&gt;&amp;nbsp; * change settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp; */&lt;/P&gt;&lt;P&gt;&amp;nbsp; pUART-&amp;gt;C2 &amp;amp;= ~(UART_C2_TE_MASK | UART_C2_RE_MASK );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Configure the UART for 8-bit mode, no parity */&lt;/P&gt;&lt;P&gt;&amp;nbsp; pUART-&amp;gt;C1 = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Calculate baud settings */&lt;/P&gt;&lt;P&gt;&amp;nbsp; //u16Sbr = (((u32SysClk)&amp;gt;&amp;gt;4) + (u32Baud&amp;gt;&amp;gt;1))/u32Baud;&lt;/P&gt;&lt;P&gt;&amp;nbsp; u16Sbr = (uint16_t)((((u32SysClk*1000)&amp;gt;&amp;gt;5))/u32Baud);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Save off the current value of the UARTx_BDH except for the SBR field */&lt;/P&gt;&lt;P&gt;&amp;nbsp; u8Temp = pUART-&amp;gt;BDH &amp;amp; ~(UART_BDH_SBR_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pUART-&amp;gt;BDH = u8Temp |&amp;nbsp; UART_BDH_SBR(((u16Sbr &amp;amp; 0x1F00) &amp;gt;&amp;gt; 8));&lt;/P&gt;&lt;P&gt;&amp;nbsp; pUART-&amp;gt;BDL = (uint8_t)(u16Sbr &amp;amp; UART_BDL_SBR_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Determine if a fractional divider is needed to get closer to the baud rate */&lt;/P&gt;&lt;P&gt;&amp;nbsp; u16Brfa = (((u32SysClk*32000)/(u32Baud * 16)) - (u16Sbr * 32));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Save off the current value of the UARTx_C4 register except for the BRFA field */&lt;/P&gt;&lt;P&gt;&amp;nbsp; u8Temp = pUART-&amp;gt;C4 &amp;amp; ~(UART_C4_BRFA(0x1F));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pUART-&amp;gt;C4 = u8Temp | UART_C4_BRFA(u16Brfa);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Enable interrupt */&lt;/P&gt;&lt;P&gt;&amp;nbsp; NVIC_SetPriority(UART5_RX_TX_IRQn,64);&lt;/P&gt;&lt;P&gt;&amp;nbsp; NVIC_ClearPendingIRQ(UART5_RX_TX_IRQn);&lt;/P&gt;&lt;P&gt;&amp;nbsp; NVIC_EnableIRQ(UART5_RX_TX_IRQn);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pUART-&amp;gt;C2 |= UART_C2_RIE_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Enable receiver and transmitter */&lt;/P&gt;&lt;P&gt;&amp;nbsp; pUART-&amp;gt;C2 |= ( UART_C2_TE_MASK | UART_C2_RE_MASK );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 19:29:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231153#M5003</guid>
      <dc:creator>johnbaker</dc:creator>
      <dc:date>2014-09-17T19:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231154#M5004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any solution you got chandra?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Team Freescale is there is any problem in driver. I am running with same problem.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Using MQX4.2 Codewarrior 10.6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2015 05:44:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231154#M5004</guid>
      <dc:creator>sudhanshumehta</dc:creator>
      <dc:date>2015-11-02T05:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: UART Txing Junk bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231155#M5005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I apologize for reviving&amp;nbsp;this old thread. However, i'm in the same boat. Below is the link to the question i had&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/467812"&gt;Kinetis K64 UART0 Baud Issue ?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Vu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 21:06:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Txing-Junk-bytes/m-p/231155#M5005</guid>
      <dc:creator>Designer11</dc:creator>
      <dc:date>2018-01-12T21:06:45Z</dc:date>
    </item>
  </channel>
</rss>

