<?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 LPC55S16 - UART Framing Error - How To Recover? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/1985698#M57193</link>
    <description>&lt;P&gt;Using an LPC55S16 to communicate via UART.&amp;nbsp; Unfortunately, the system has some noise, and the RX line is occasionally pulled low momentarily, which the UART interprets as a start bit.&amp;nbsp; This ultimately leads to a framing error.&lt;/P&gt;&lt;P&gt;What is the suggested methodology for recovering from a framing error?&amp;nbsp; I'd was thinking just vector on a framing error, reset some flags, and throw out the byte.&amp;nbsp; But this is just a high level concept.&amp;nbsp; Can I please get a detailed description of what should be done in this situation?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2024 16:30:40 GMT</pubDate>
    <dc:creator>JK_265</dc:creator>
    <dc:date>2024-10-31T16:30:40Z</dc:date>
    <item>
      <title>LPC55S16 - UART Framing Error - How To Recover?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/1985698#M57193</link>
      <description>&lt;P&gt;Using an LPC55S16 to communicate via UART.&amp;nbsp; Unfortunately, the system has some noise, and the RX line is occasionally pulled low momentarily, which the UART interprets as a start bit.&amp;nbsp; This ultimately leads to a framing error.&lt;/P&gt;&lt;P&gt;What is the suggested methodology for recovering from a framing error?&amp;nbsp; I'd was thinking just vector on a framing error, reset some flags, and throw out the byte.&amp;nbsp; But this is just a high level concept.&amp;nbsp; Can I please get a detailed description of what should be done in this situation?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 16:30:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/1985698#M57193</guid>
      <dc:creator>JK_265</dc:creator>
      <dc:date>2024-10-31T16:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S16 - UART Framing Error - How To Recover?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/1986156#M57199</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196991"&gt;@JK_265&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can refer to lpc55s16_usart_interrupt example.&lt;/P&gt;
&lt;P&gt;But you need change some code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;USART_EnableInterrupts(DEMO_USART, kUSART_RxLevelInterruptEnable | kUSART_RxErrorInterruptEnable);&lt;/LI-CODE&gt;
&lt;P&gt;change to&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;USART_EnableInterrupts(DEMO_USART, kUSART_RxLevelInterruptEnable | kUSART_RxErrorInterruptEnable | kUSART_FramingErrorInterruptEnable);&lt;/LI-CODE&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;And you also need to change&amp;nbsp;DEMO_USART_IRQHandler function.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;void DEMO_USART_IRQHandler(void)
{
    uint8_t data;

    /* If new data arrived. */
    if ((kUSART_RxFifoNotEmptyFlag | kUSART_RxError) &amp;amp; USART_GetStatusFlags(DEMO_USART))
    {
        data = USART_ReadByte(DEMO_USART);
        /* If ring buffer is not full, add data to ring buffer. */
        if (((rxIndex + 1) % DEMO_RING_BUFFER_SIZE) != txIndex)
        {
            demoRingBuffer[rxIndex] = data;
            rxIndex++;
            rxIndex %= DEMO_RING_BUFFER_SIZE;
        }
    }
    if (kUSART_FramingErrorInterruptEnable &amp;amp; USART_GetStatusFlags(DEMO_USART))
    {
    	uint8_t discard = USART_ReadByte(DEMO_USART);
    	errorCounter++;
    }
    SDK_ISR_EXIT_BARRIER;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Hang&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 09:04:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/1986156#M57199</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2024-11-01T09:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S16 - UART Framing Error - How To Recover?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/1995674#M57258</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229957"&gt;@Harry_Zhang&lt;/a&gt;&amp;nbsp; I am currently working in a polling mode where this issue occurs when using USART_READBlocking( which returns 0x5711, framing error).&amp;nbsp; What to do in this situation?&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:56:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/1995674#M57258</guid>
      <dc:creator>JK_265</dc:creator>
      <dc:date>2024-11-15T21:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S16 - UART Framing Error - How To Recover?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/2003988#M57325</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196991"&gt;@JK_265&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This means that the received frame is incorrect.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_0-1732845613288.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/313217i6458F7B1FBC26630/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_0-1732845613288.png" alt="Harry_Zhang_0-1732845613288.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you use this example to automatically discard frames when they are received incorrectly, and receive frames when they are received correctly.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 02:00:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S16-UART-Framing-Error-How-To-Recover/m-p/2003988#M57325</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2024-11-29T02:00:32Z</dc:date>
    </item>
  </channel>
</rss>

