<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SAADC Easy DMA with 1 Channel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20982/saadc-easy-dma-with-1-channel</link><description>I am using SAADC and reading in 1 analog channel. The data sheet says that scan mode is enabled when 2 or more channels are turned on. What if I am only using 1 channel ? How can I turn on scan mode and have the DMA store the results in memory? 
 Right</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Apr 2017 16:01:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20982/saadc-easy-dma-with-1-channel" /><item><title>RE: SAADC Easy DMA with 1 Channel</title><link>https://devzone.nordicsemi.com/thread/82014?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2017 16:01:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b431643-74e3-43b2-825b-a7aa7bb3a313</guid><dc:creator>radioschmadio</dc:creator><description>&lt;p&gt;Duhhhhhhhhhhh.  Works fine now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Easy DMA with 1 Channel</title><link>https://devzone.nordicsemi.com/thread/82013?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2017 08:52:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c164bc2-58a1-4ce6-b781-316af68db820</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you call &lt;code&gt;NVIC_EnableIRQ(SAADC_IRQn);&lt;/code&gt; in your code to register the peripheral with the interrupt controller? I would also recommend that you check out &lt;a href="https://github.com/Martinsbl/nrf52-saadc-continuous-mode-rtc-ppi-register-setup/blob/master/main.c"&gt;this example&lt;/a&gt;, which is written by one of my colleagues. You can change it to run continuously by doing the changes as described in &lt;a href="https://devzone.nordicsemi.com/question/112783/how-to-run-nrf52-saadc-continuously-non-stop-without-interrupts/"&gt;this thread&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Easy DMA with 1 Channel</title><link>https://devzone.nordicsemi.com/thread/82012?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 15:42:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d6f228a-241e-4ff7-bce9-df93be1fd133</guid><dc:creator>radioschmadio</dc:creator><description>&lt;p&gt;So, for some reason it started working, but for some reason I can not get the interrupt to trigger to do another sample.  I would like it to continuously sample the one channel.  I enabled all the interrupts and still nothing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Easy DMA with 1 Channel</title><link>https://devzone.nordicsemi.com/thread/82011?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 15:37:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57dd6875-196c-404f-96cf-b3dc53dab47d</guid><dc:creator>radioschmadio</dc:creator><description>&lt;p&gt;uint32_t adc_results[1024]={0};&lt;/p&gt;
&lt;p&gt;void setup_adc()
{
NRF_SAADC -&amp;gt;ENABLE = 0;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	NRF_SAADC -&amp;gt;RESOLUTION = 2 ; //12 bit resolution
	NRF_SAADC -&amp;gt;OVERSAMPLE = 0; //bypass over sampling

	NRF_SAADC -&amp;gt;RESULT.PTR = (uint32_t)&amp;amp;adc_results[0];
	NRF_SAADC -&amp;gt;RESULT.MAXCNT = 512; 
	NRF_SAADC -&amp;gt;SAMPLERATE= 0x000010FF;  //fast sample rate auto 

	NRF_SAADC -&amp;gt;CH[0].CONFIG = 	(SAADC_CH_CONFIG_BURST_Disabled &amp;lt;&amp;lt; SAADC_CH_CONFIG_BURST_Pos) | \
															(SAADC_CH_CONFIG_MODE_SE &amp;lt;&amp;lt; SAADC_CH_CONFIG_MODE_Pos ) | \
															(SAADC_CH_CONFIG_TACQ_10us &amp;lt;&amp;lt; SAADC_CH_CONFIG_TACQ_Pos ) | \
															(SAADC_CH_CONFIG_REFSEL_Internal &amp;lt;&amp;lt; SAADC_CH_CONFIG_REFSEL_Pos) | \
															(SAADC_CH_CONFIG_GAIN_Gain1_6 &amp;lt;&amp;lt; SAADC_CH_CONFIG_GAIN_Pos ) | \
															(SAADC_CH_CONFIG_RESN_Bypass &amp;lt;&amp;lt; SAADC_CH_CONFIG_RESN_Pos ) | \
															(SAADC_CH_CONFIG_RESP_Bypass &amp;lt;&amp;lt; SAADC_CH_CONFIG_RESP_Pos ) ;

	NRF_SAADC -&amp;gt;CH[0].LIMIT = 0;
	NRF_SAADC -&amp;gt;CH[0].PSELN = 0;
	NRF_SAADC -&amp;gt;CH[0].PSELP = 2;

	NRF_SAADC -&amp;gt;INTEN = 0x0000000E ; //enable int for end
	NRF_SAADC -&amp;gt;ENABLE = 1;
	NRF_SAADC -&amp;gt;TASKS_START = 1;
	
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void start_adc()
{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//NRF_SAADC -&amp;gt;TASKS_START = 1;
NRF_SAADC -&amp;gt;TASKS_SAMPLE = 1;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void SAADC_IRQHandler (void)
{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_SAADC -&amp;gt;INTEN = 0x00000000 ; //disable int for end
NRF_SAADC -&amp;gt;EVENTS_END = 0; //clear event
NRF_SAADC -&amp;gt;EVENTS_DONE = 0; //clear event
NRF_SAADC -&amp;gt;EVENTS_RESULTDONE = 0; //clear event
//NRF_SAADC -&amp;gt;TASKS_START = 1;
    //NRF_SAADC -&amp;gt;TASKS_SAMPLE = 1;
NRF_SAADC -&amp;gt;RESULT.PTR = (uint32_t)&amp;amp;adc_results[0];
NRF_SAADC -&amp;gt;INTEN = 0x00000002 ; //enable int for end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Easy DMA with 1 Channel</title><link>https://devzone.nordicsemi.com/thread/82010?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 09:40:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2058cb34-0177-406e-a5fb-c0ac9a4fd968</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you mean that you have a buffer with a size &amp;gt; 1, and you only get one sample in the buffer? Could you post some code showing how you do sampling?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>