<?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: Reading UART Tx FIFO level in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526176#M8809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Mon Dec 10 09:36:47 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Dave, you mean you have to actually type the meta codes in? There's no buttons for quote, code, url etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And now it seems I can't edit my post. What kind of forum software is this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, FWIW, responses on other forums indicate that this is a bug in the chip, reading FIFOLVL does not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:01:23 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:01:23Z</dc:date>
    <item>
      <title>Reading UART Tx FIFO level</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526174#M8807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Sun Dec 09 17:26:33 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm writing a driver for a UART (on the 1227), so far it's working well but if I send too many bytes the FIFO fills and I lose characters. No problem I just write a buffer function that creates a software FIFO for the overflow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So to implement that I need to test the hardware FIFO level, if it's full write to the software buffer, if not write directly to the hardware. But no matter what I do I get a value of 0 for LPC_UART0-&amp;gt;FIFOLVL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the test code I'm currently using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void serialWrite (uint8 b) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8 x = (LPC_UART0-&amp;gt;FIFOLVL &amp;gt;&amp;gt; 8) &amp;amp; 0x0F;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (x &amp;lt; 15) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART0-&amp;gt;THR = 0x11;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART0-&amp;gt;THR = 0x22;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART0-&amp;gt;THR = 0x33;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART0-&amp;gt;THR = LPC_UART0-&amp;gt;FIFOLVL &amp;gt;&amp;gt; 8;&amp;nbsp; // !!!!!!!!!!!!!! this is always 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART0-&amp;gt;THR = 0x44;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fifoWrite (s-&amp;gt;TxBuffer, b);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(what's with no CODE tags on this forum?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because I think stopping the processor to use the debugger will allow the FIFO to empty and give me a bogus reading of FIFOLVL for testing I write three bytes into the FIFO then write the TXFIFOLVL bits from the register and finally another byte just to frame the level data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I always get 0 for the LPC_UART0-&amp;gt;FIFOLVL &amp;gt;&amp;gt; 8 byte when presumably it should be 4. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should be simple right? Am I missing a secret handshake or something?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:01:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526174#M8807</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading UART Tx FIFO level</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526175#M8808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Dave on Sun Dec 09 23:20:12 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding CODE tags:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fproject%2Flpcwarecom-help%2Fhighlighting-code" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/project/lpcwarecom-help/highlighting-code&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:01:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526175#M8808</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reading UART Tx FIFO level</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526176#M8809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Mon Dec 10 09:36:47 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Dave, you mean you have to actually type the meta codes in? There's no buttons for quote, code, url etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And now it seems I can't edit my post. What kind of forum software is this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, FWIW, responses on other forums indicate that this is a bug in the chip, reading FIFOLVL does not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:01:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526176#M8809</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reading UART Tx FIFO level</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526177#M8810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Daniel Widyanto on Tue Dec 18 23:14:18 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The LPC12xx, along with LPC11xx and LPC13xx, does not implement FIFOLVL register. Only the LPC17xx above (LPC177x, LPC18xx, and LPC4xxx) that has this feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for brought this up. We'll update the LPC12xx User Manual to fix this issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:01:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526177#M8810</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reading UART Tx FIFO level</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526178#M8811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tiagolone on Tue Jan 28 12:58:46 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is some other way to know if the TX FIFO is full in lpc1227?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, manual has not been updated yet. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:01:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Reading-UART-Tx-FIFO-level/m-p/526178#M8811</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:01:24Z</dc:date>
    </item>
  </channel>
</rss>

