<?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>nrf52 multiple signal sampling with softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14702/nrf52-multiple-signal-sampling-with-softdevice</link><description>I migrated to nrf52 and countering some problems.
I am trying to sample 4 pins every 2ms with SAADC. 
 I started with Example here . 
 I simply changed 
 uint32_t ticks = SAADC_SAMPLE_RATE_DIVIDER;
nrf_drv_timer_extended_compare(&amp;amp;m_timer, NRF_TIMER_CC_CHANNEL0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Jun 2016 15:23:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14702/nrf52-multiple-signal-sampling-with-softdevice" /><item><title>RE: nrf52 multiple signal sampling with softdevice</title><link>https://devzone.nordicsemi.com/thread/56095?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 15:23:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ec9ae32-8c7d-4a69-9bbd-c732cd67f608</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi John&lt;/p&gt;
&lt;p&gt;I think the SAADC is well capable of sampling with 500Hz. It should not take more than 42us to sample, so even if you take multiple samples, there should not be a problem on the SAADC side.&lt;/p&gt;
&lt;p&gt;There might however be a problem on the BLE side. What connection interval have you chosen? If you are sending each sample over BLE, you will overflood the softdevice with packets. The softdevice should however normally not disconnect, it should just report error and not accept packets when the softdevice buffers are full, and then accept more packets when space becomes available again in the softdevice buffers.&lt;/p&gt;
&lt;p&gt;Since each packet can contain 20 bytes, you could insert 10 samples into each packet, i.e. call hvx function once with 10 samples. You could also set connection interval to minimum 7.5 ms and configure the softdevice to send 6 packets (setting BLE_CONN_BW_HIGH) per connection interval to obtain maximum throughput, see the &lt;a href="https://www.nordicsemi.com/eng/nordic/Products/nRF52832/S132-SD-v2/51479"&gt;S132 v2.0.1 migration document&lt;/a&gt;, which is bundled within the S132 softdevice download. Look in the &amp;quot;Configurable bandwidth&amp;quot; section.&lt;/p&gt;
&lt;p&gt;Yes, the SAADC in the example that you point to uses TIMER and PPI to trigger SAADC sampling. When sampling is complete, the SAADC will automatically transfer the samples to RAM. When the RAM buffer is full the SAADC interrupt handler will need to process the data and CPU is needed for that.&lt;/p&gt;
&lt;p&gt;There is an updated &lt;a href="https://github.com/NordicSemiconductor/nRF52-ADC-examples/tree/master/ble_app_uart__saadc_timer_driven__scan_mode"&gt;example now on github&lt;/a&gt; that uses BLE and also scan mode to sample on multiple pins.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>