<?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: plz help me on this code in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/plz-help-me-on-this-code/m-p/517141#M2029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by navidrct on Thu Jun 11 02:12:25 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: TheFallGuy&lt;/STRONG&gt;&lt;BR /&gt;You need to be using LPCOpen. Start by reading the LPCOpen docs for your target&lt;BR /&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%2Flpcopen-platform-nxp-lpc-microcontrollers%2Flpcopen-v200-quickstart-guides%2Flpcopen-1" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quickstart-guides/lpcopen-1&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Flpcopen" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/lpcopen&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;1UL is standard C. It means "the value 1 typed as an unsigned long". Get yourself a good C book...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks.i'll check it&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:27:00 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:27:00Z</dc:date>
    <item>
      <title>plz help me on this code</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/plz-help-me-on-this-code/m-p/517139#M2027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by navidrct on Wed Jun 10 23:44:58 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;what lib should i include to use LPC_ADC instruction?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;what is 1UL in this code?what does it mean?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;im new in this.if u can comment this code more than this i apericiate it&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_ADC-&amp;gt;ADCR = 0; // Power AD down
 LPC_SC-&amp;gt;PCONP |= (1 &amp;lt;&amp;lt; 12); // Enable power to AD block
LPC_SC-&amp;gt;PCLKSEL0 &amp;amp;= ~(1&amp;lt;&amp;lt;24); // clock 25 MHz
LPC_SC-&amp;gt;PCLKSEL0 &amp;amp;= ~(1&amp;lt;&amp;lt;25);
LPC_ADC-&amp;gt;ADCR = 7 &amp;lt;&amp;lt; 8; // conversion clock = 100 Mhz / 8 [7+1] = 12.5 MHz
LPC_ADC-&amp;gt;ADCR |= (1&amp;lt;&amp;lt;21); // PDN = set AD operational
LPC_ADC-&amp;gt;ADCR |= (1&amp;lt;&amp;lt;0); // SEL = select AD0.0 to start

int Good = 1;
int Bad = 0;
while(1)
{
LPC_ADC-&amp;gt;ADCR |= (1&amp;lt;&amp;lt;24); // START = start conversion now
while (!(LPC_ADC-&amp;gt;ADGDR &amp;amp; ( 1UL &amp;lt;&amp;lt; 31)))
;&amp;nbsp; /* Wait for Conversion end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */
int value = (LPC_ADC-&amp;gt;ADDR0 &amp;gt;&amp;gt; 4) &amp;amp; 0xFFF;
if((value &amp;lt; 0x580) || (value &amp;gt; 0x5FF))
Bad++;
else
Good++;
double pct = (double)Bad * 100 / (double)Good;
Debug("AN0 = %X good %5d bad %5d %.02f%%", value, Good , Bad, pct);
os_dly_wait(25);
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:26:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/plz-help-me-on-this-code/m-p/517139#M2027</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: plz help me on this code</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/plz-help-me-on-this-code/m-p/517140#M2028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Thu Jun 11 01:06:28 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to be using LPCOpen. Start by reading the LPCOpen docs for your target&lt;/SPAN&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%2Flpcopen-platform-nxp-lpc-microcontrollers%2Flpcopen-v200-quickstart-guides%2Flpcopen-1" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quickstart-guides/lpcopen-1&lt;/A&gt;&lt;/SPAN&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%2Flpcopen" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/lpcopen&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1UL is standard C. It means "the value 1 typed as an unsigned long". Get yourself a good C book...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:26:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/plz-help-me-on-this-code/m-p/517140#M2028</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: plz help me on this code</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/plz-help-me-on-this-code/m-p/517141#M2029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by navidrct on Thu Jun 11 02:12:25 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: TheFallGuy&lt;/STRONG&gt;&lt;BR /&gt;You need to be using LPCOpen. Start by reading the LPCOpen docs for your target&lt;BR /&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%2Flpcopen-platform-nxp-lpc-microcontrollers%2Flpcopen-v200-quickstart-guides%2Flpcopen-1" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quickstart-guides/lpcopen-1&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Flpcopen" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/lpcopen&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;1UL is standard C. It means "the value 1 typed as an unsigned long". Get yourself a good C book...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks.i'll check it&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:27:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/plz-help-me-on-this-code/m-p/517141#M2029</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:27:00Z</dc:date>
    </item>
  </channel>
</rss>

