<?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: ADC Burst? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1336484#M46427</link>
    <description>&lt;P&gt;Aey, It works in software mode. I use one channel at a time with interrupt. In the ISR I read the adc value for the current channel, then I setup the adc for the next channel. I can then start the timer at arbitrary time intervals (like, 1ms, 10ms or whatever).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Sep 2021 05:17:31 GMT</pubDate>
    <dc:creator>bmildh</dc:creator>
    <dc:date>2021-09-08T05:17:31Z</dc:date>
    <item>
      <title>ADC Burst?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1335903#M46421</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get ADC Burst working on my LPC1758, but It seems like my ADC ISR does not fire. If anyone could shed some light on this I would be most grateful.&lt;/P&gt;&lt;P&gt;The way that I think I understand it, burst-mode should give me continuous ADC conversion on the channels that I select. If I have selected channel 2,4,5 and 7, and also enable the interrupt for channel 7, then, when channel 7 finish a conversion, I should be able to harvest the values for channel 2,4,5 and 7.&lt;/P&gt;&lt;P&gt;This is my initialization:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define SBIT_AD0_CLCKDIV	8u		// ADC0CR (Bits 15:8)
#define SBIT_AD0_BURST		16u		// ADC0CR 
#define SBIT_AD0_PDN		21u		// ADC0CR
#define SBIT_AD0_START		24u		// ADC0CR (Bits 26:24)
#define SBIT_AD0_EDGE		27u		// ADC0CR 
#define SBIT_AD0_ADGINTEN	8u		// AD0INTEN
#define SBIT_AD0_PCADC		12u		// PCONP
#define SBIT_AD0_INTEN2		2u
#define SBIT_AD0_INTEN4		4u		// AD0INTEN
#define SBIT_AD0_INTEN5		5u
#define SBIT_AD0_INTEN7		7u

void Init_ADC(void)
{
	set_PINSEL(0,25,1);		// Ch 2
	set_PINSEL(1,30,3);		// Ch 4 
	set_PINSEL(1,31,3);		// Ch 5 
	set_PINSEL(0,2,2); 		// Ch 7 

	// No pull-up no pull-down (function ADC) 
	set_PINMODE(0,25,NOPULL);	// Ch 2
	set_PINMODE(1,30,NOPULL); 	// Ch 4
	set_PINMODE(1,31,NOPULL); 	// Ch 5
	set_PINMODE(0,2,NOPULL);	// Ch 7 
	
	// ADC enabled, turning on power
	LPC_SC-&amp;gt;PCONP |= (1&amp;lt;&amp;lt;SBIT_AD0_PCADC); 

	// Stop ADC (in burst mode this should be 000)		
	LPC_ADC-&amp;gt;CR &amp;amp;= ~(7&amp;lt;&amp;lt;SBIT_AD0_START); 	

	// Enable interrupt on all of the selected channels
	LPC_ADC-&amp;gt;INTEN &amp;amp;= ~(1&amp;lt;&amp;lt;SBIT_AD0_ADGINTEN);
	LPC_ADC-&amp;gt;INTEN |= (1&amp;lt;&amp;lt;SBIT_AD0_INTEN7) | (1&amp;lt;&amp;lt;SBIT_AD0_INTEN2) | (1&amp;lt;&amp;lt;SBIT_AD0_INTEN4) | (1&amp;lt;&amp;lt;SBIT_AD0_INTEN5);

	// Select channel 2,4,5,7
	LPC_ADC-&amp;gt;CR |= ((1&amp;lt;&amp;lt;2) | (1&amp;lt;&amp;lt;4) | (1&amp;lt;&amp;lt;5) | (1&amp;lt;&amp;lt;7));		
	
	// PCLK = CCLK / 2 =&amp;gt; 40Mhz; We divide the PCLK with 4 and get 10Mhz.
        // The ADC clock should be 13Mhz or slightly less (see doc)
	LPC_ADC-&amp;gt;CR |= ((4-1)&amp;lt;&amp;lt;SBIT_AD0_CLCKDIV);
	
	// Enable burst mode
	LPC_ADC-&amp;gt;CR |= (1&amp;lt;&amp;lt;SBIT_AD0_BURST);						
	
	// ADC operational
	LPC_ADC-&amp;gt;CR |= (1&amp;lt;&amp;lt;SBIT_AD0_PDN);			
	
	NVIC_EnableIRQ(ADC_IRQn);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is my ISR: (right now I'm only interesting in the &lt;STRONG&gt;ADCbusyflag&lt;/STRONG&gt;. I just want to know if this flag is set. In my main loop I print out on serial every second, the value of &lt;STRONG&gt;ADCbusyflag&lt;/STRONG&gt;. The value is always zero, indicating that the ISR is never called. Also, the &lt;STRONG&gt;STAT&lt;/STRONG&gt; register of the ADC is always zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void ADC_IRQHandler(void)
{
	ADCmean[7] = ((LPC_ADC-&amp;gt;DR[7]&amp;gt;&amp;gt;4) &amp;amp; 0x0FFF);
	ADCmean[5] = ((LPC_ADC-&amp;gt;DR[5]&amp;gt;&amp;gt;4) &amp;amp; 0x0FFF);
	ADCmean[2] = ((LPC_ADC-&amp;gt;DR[2]&amp;gt;&amp;gt;4) &amp;amp; 0x0FFF);
	ADCmean[4] = ((LPC_ADC-&amp;gt;DR[4]&amp;gt;&amp;gt;4) &amp;amp; 0x0FFF);
	ADCbusyflag = 1;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm I missing?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:28:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1335903#M46421</guid>
      <dc:creator>bmildh</dc:creator>
      <dc:date>2021-09-07T08:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Burst?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1336428#M46425</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188666" target="_self" aria-label="View Profile of bmildh"&gt;&lt;SPAN class=""&gt;bmildh&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Have you test whether it works well when without burst mode?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And confirm connect to the right pin to ADC signal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 02:54:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1336428#M46425</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2021-09-08T02:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Burst?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1336484#M46427</link>
      <description>&lt;P&gt;Aey, It works in software mode. I use one channel at a time with interrupt. In the ISR I read the adc value for the current channel, then I setup the adc for the next channel. I can then start the timer at arbitrary time intervals (like, 1ms, 10ms or whatever).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 05:17:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1336484#M46427</guid>
      <dc:creator>bmildh</dc:creator>
      <dc:date>2021-09-08T05:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Burst?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1337300#M46432</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;How about just enable channel 7 interrupt?&lt;/P&gt;
&lt;P&gt;If still can't work, you can attach your project, I will check it on my side.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 02:17:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1337300#M46432</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2021-09-09T02:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Burst?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1337444#M46436</link>
      <description>&lt;P&gt;I tried just enabling channel 7 interrupt, but no dice.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I'll figure It out, probably just some bit in some register that is wrong. It usually is &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 06:27:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ADC-Burst/m-p/1337444#M46436</guid>
      <dc:creator>bmildh</dc:creator>
      <dc:date>2021-09-09T06:27:52Z</dc:date>
    </item>
  </channel>
</rss>

