<?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>LPC Microcontrollers中的主题 adc problem in LPC2148</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/adc-problem-in-LPC2148/m-p/589602#M21943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we are using ADC0 to measure voltage of a sensor which gives output 4 to 40mamp.&lt;/P&gt;&lt;P&gt;But sometimes the ADC conversion is not wokring.it is wiaitng at conversion only.&lt;/P&gt;&lt;P&gt;The code what we are using is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PINSEL1 |= 0x01000000; // channel 0 in adc0&lt;BR /&gt; AD0CR &amp;amp;= 0xffffff00;&lt;BR /&gt; AD0CR |= 0x00000002; // Select ADC = AD0.1 &lt;BR /&gt; // START = 001 = Start Conversion Now&lt;BR /&gt; AD0CR |= 0x01000000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while((AD0DR1 &amp;amp; 0x80000000) == 0);&amp;nbsp;// Wait ADC Conversion to Complete and Read A/D Data Register&lt;BR /&gt;&lt;BR /&gt; val = (unsigned int)(AD0DR1 &amp;gt;&amp;gt; 6) &amp;amp; 0x000003FF;&lt;BR /&gt; AD0CR &amp;amp;= 0xF8FFFFFF;&lt;BR /&gt; return (val);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help us in this issue.&lt;/P&gt;&lt;P&gt;thank you in advance&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Sep 2016 08:04:15 GMT</pubDate>
    <dc:creator>jagadeshwarredd</dc:creator>
    <dc:date>2016-09-03T08:04:15Z</dc:date>
    <item>
      <title>adc problem in LPC2148</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/adc-problem-in-LPC2148/m-p/589602#M21943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we are using ADC0 to measure voltage of a sensor which gives output 4 to 40mamp.&lt;/P&gt;&lt;P&gt;But sometimes the ADC conversion is not wokring.it is wiaitng at conversion only.&lt;/P&gt;&lt;P&gt;The code what we are using is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PINSEL1 |= 0x01000000; // channel 0 in adc0&lt;BR /&gt; AD0CR &amp;amp;= 0xffffff00;&lt;BR /&gt; AD0CR |= 0x00000002; // Select ADC = AD0.1 &lt;BR /&gt; // START = 001 = Start Conversion Now&lt;BR /&gt; AD0CR |= 0x01000000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while((AD0DR1 &amp;amp; 0x80000000) == 0);&amp;nbsp;// Wait ADC Conversion to Complete and Read A/D Data Register&lt;BR /&gt;&lt;BR /&gt; val = (unsigned int)(AD0DR1 &amp;gt;&amp;gt; 6) &amp;amp; 0x000003FF;&lt;BR /&gt; AD0CR &amp;amp;= 0xF8FFFFFF;&lt;BR /&gt; return (val);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help us in this issue.&lt;/P&gt;&lt;P&gt;thank you in advance&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2016 08:04:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/adc-problem-in-LPC2148/m-p/589602#M21943</guid>
      <dc:creator>jagadeshwarredd</dc:creator>
      <dc:date>2016-09-03T08:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: adc problem in LPC2148</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/adc-problem-in-LPC2148/m-p/589603#M21944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According with your code, most of the initialization seems to be good. However, it doesn’t show the clock reference, as the ADC clock divisor is set to divide by 1, and, by spec, the ADC clock must be lees or equal to 4.5 MHz; besides, the PDN bit is not set on the code, which means that the ADC will not be operational, so, you should verify that.&lt;/P&gt;&lt;P&gt;Additionally, are you running the code on an infinite loop? Because the general recommendation is setting pins/clocks first and then, just launching the conversion and waiting for the competition on the infinite loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As complementary info, you could take a look at the following page:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ocfreaks.com/lpc2148-adc-programming-tutorial/"&gt;http://www.ocfreaks.com/lpc2148-adc-programming-tutorial/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will be useful for you.&lt;BR /&gt;Best regards!&lt;BR /&gt;/Carlos&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Sep 2016 15:05:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/adc-problem-in-LPC2148/m-p/589603#M21944</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2016-09-24T15:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: adc problem in LPC2148</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/adc-problem-in-LPC2148/m-p/589604#M21945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you sir,&lt;/P&gt;&lt;P&gt;We have used fallowing code for intilaising&amp;nbsp;&lt;/P&gt;&lt;P&gt;AD0CR &amp;amp;= 0x00000000; // Clear All Bit Control&lt;BR /&gt; AD0CR |= 0x00000400; // ADC Clock = VPB(PCLK) / 8&lt;BR /&gt; AD0CR &amp;amp;= 0xFFFEFFFF; // Busrt = 0 - Conversions are software controlled and reguire 11 clocks&lt;BR /&gt; AD0CR &amp;amp;= 0xFFF1FFFF; // CLKS = 000 - 10Bit : 11 Cycle Clock Conversion&lt;BR /&gt; AD0CR |= 0x00200000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using 12Mhz Crystal for controller&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 12:39:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/adc-problem-in-LPC2148/m-p/589604#M21945</guid>
      <dc:creator>jagadeshwarredd</dc:creator>
      <dc:date>2016-10-03T12:39:11Z</dc:date>
    </item>
  </channel>
</rss>

