<?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 LPC1788 ADC Burst Mode Issues in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1788-ADC-Burst-Mode-Issues/m-p/548928#M10751</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kralux on Tue Oct 04 03:17:53 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to converter two ADC channels (0 and 2) in burst mode. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue is that it always returns 0 as the converted value so something must be wrong. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that the ADC is performing conversion but maybe the pin config is not right (however I have triple checked it and cannot find the issue, hence this post).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code use by the ADC is as such:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
LPC_ADC-&amp;gt;CR = (1 &amp;lt;&amp;lt; 21) | (9 &amp;lt;&amp;lt; 8); // Set PDN bit -&amp;gt; operational | CLKDIV = 9+1 -&amp;gt; 10MHz ADC clock
LPC_ADC-&amp;gt;INTEN = 0; // disable all IRQs for ADC.

...

LPC_IOCON-&amp;gt;P0_23 = (1 &amp;lt;&amp;lt; 8) + 0x1; // ADC0[0]
LPC_IOCON-&amp;gt;P0_25 = (1 &amp;lt;&amp;lt; 8) + 0x1; // ADC0[2]

...

LPC_ADC-&amp;gt;CR &amp;amp;= 0xFFFEFF00; // deselect all channels. Stop ADC.
LPC_ADC-&amp;gt;CR |= (1 &amp;lt;&amp;lt; 0) | (1 &amp;lt;&amp;lt; 2);// sel Channels
LPC_ADC-&amp;gt;CR |= (1 &amp;lt;&amp;lt; 16); // Burst mode ON!
volatile uint32_t dataRegister;
do {
dataRegister = LPC_ADC-&amp;gt;DR[0];
} while ((dataRegister &amp;amp; ADC_DONE) == 0);
// Now can process last sample
ProcessData(dataRegister);
do {
dataRegister = LPC_ADC-&amp;gt;DR[2];
} while ((dataRegister &amp;amp; ADC_DONE) == 0);
LPC_ADC-&amp;gt;CR &amp;amp;= ~(1 &amp;lt;&amp;lt; 16); // STOP bursting...last one will be done anyway
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that the PCON (power control) has the ADC bit enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the dataRegister always returns 0 for the converted bits. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have check the pins on the LPC and the voltage is not zero (actually about 2V with a 3.3V supply). The analog VREFP and VDDA are connected to 3.3V and VSSA to GND.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The fact that conversions are happening (otherwise would be stuck in the do while loop), and that the result is always zero seems to point to a wrong IO Config but I can't find it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help with this would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:26:13 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:26:13Z</dc:date>
    <item>
      <title>LPC1788 ADC Burst Mode Issues</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1788-ADC-Burst-Mode-Issues/m-p/548928#M10751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kralux on Tue Oct 04 03:17:53 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to converter two ADC channels (0 and 2) in burst mode. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue is that it always returns 0 as the converted value so something must be wrong. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that the ADC is performing conversion but maybe the pin config is not right (however I have triple checked it and cannot find the issue, hence this post).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code use by the ADC is as such:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
LPC_ADC-&amp;gt;CR = (1 &amp;lt;&amp;lt; 21) | (9 &amp;lt;&amp;lt; 8); // Set PDN bit -&amp;gt; operational | CLKDIV = 9+1 -&amp;gt; 10MHz ADC clock
LPC_ADC-&amp;gt;INTEN = 0; // disable all IRQs for ADC.

...

LPC_IOCON-&amp;gt;P0_23 = (1 &amp;lt;&amp;lt; 8) + 0x1; // ADC0[0]
LPC_IOCON-&amp;gt;P0_25 = (1 &amp;lt;&amp;lt; 8) + 0x1; // ADC0[2]

...

LPC_ADC-&amp;gt;CR &amp;amp;= 0xFFFEFF00; // deselect all channels. Stop ADC.
LPC_ADC-&amp;gt;CR |= (1 &amp;lt;&amp;lt; 0) | (1 &amp;lt;&amp;lt; 2);// sel Channels
LPC_ADC-&amp;gt;CR |= (1 &amp;lt;&amp;lt; 16); // Burst mode ON!
volatile uint32_t dataRegister;
do {
dataRegister = LPC_ADC-&amp;gt;DR[0];
} while ((dataRegister &amp;amp; ADC_DONE) == 0);
// Now can process last sample
ProcessData(dataRegister);
do {
dataRegister = LPC_ADC-&amp;gt;DR[2];
} while ((dataRegister &amp;amp; ADC_DONE) == 0);
LPC_ADC-&amp;gt;CR &amp;amp;= ~(1 &amp;lt;&amp;lt; 16); // STOP bursting...last one will be done anyway
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that the PCON (power control) has the ADC bit enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the dataRegister always returns 0 for the converted bits. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have check the pins on the LPC and the voltage is not zero (actually about 2V with a 3.3V supply). The analog VREFP and VDDA are connected to 3.3V and VSSA to GND.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The fact that conversions are happening (otherwise would be stuck in the do while loop), and that the result is always zero seems to point to a wrong IO Config but I can't find it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help with this would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:26:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1788-ADC-Burst-Mode-Issues/m-p/548928#M10751</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 ADC Burst Mode Issues</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1788-ADC-Burst-Mode-Issues/m-p/548929#M10752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kralux on Wed Oct 05 00:40:01 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Found out that this code works really well actually. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The main issue was that my LPC1788 had gone bad because of an accidental potential on one of the ADC pins (4.5V) which ended up killing the ADC internals and it would always return 0.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:26:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1788-ADC-Burst-Mode-Issues/m-p/548929#M10752</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 ADC Burst Mode Issues</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1788-ADC-Burst-Mode-Issues/m-p/548930#M10753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kralux on Wed Oct 05 15:49:54 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Closing it per previous post.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:26:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1788-ADC-Burst-Mode-Issues/m-p/548930#M10753</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:26:14Z</dc:date>
    </item>
  </channel>
</rss>

