<?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>NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings</link><description>hello Nordic 
 
 i am using nrf 52840 dev kit, sdk 16.0 
 i want to make a sampling of 2 channels at 32MHz rate. the data shell be passed to RAM via easyDMA, after every 4 samplings i whish to raise an interrupt so i can average the readings from each</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Dec 2020 12:28:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings" /><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/285059?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 12:28:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de28f8e4-57e6-470b-9a74-08e2991913c0</guid><dc:creator>haakonsh</dc:creator><description>[quote user="ziv123"]or is it enough to call the first convert only (with the m_buff_pool[0]) and the second element of the buff will be prepared within the NRFX_SAADC_EVT_DONE ?[/quote]
&lt;p&gt;&amp;nbsp;No, the first time you need to call it twice with the two buffers.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="ziv123"]I have read it but not all of it and it does not make me an expert yet, there is still much clarifications to be given even after reading data sheet cause there is not enough guidance regarding programing and working with the SDK to my humble opinion, this is why i also seek for help in the forum[/quote]
&lt;p&gt;&amp;nbsp;I suggest you read the driver implementation as it show how to interpret the spec, also, the HAL might be easier to understand than the driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/285047?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 12:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e767e0c-4ffe-43eb-9bc4-09e634f9e9a2</guid><dc:creator>ziv123</dc:creator><description>[quote userid="13562" url="~/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings/285022#285022"]It prepares the current buffer to be used again for the next iteration. The driver alternates&amp;nbsp;2 buffers.&amp;nbsp;[/quote]
&lt;p&gt;so in the saadc_init function do i really need to prepper both elements of the buffer like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;or is it enough to call the first convert only (with the m_buff_pool[0]) and the second element of the buff will be prepared within the NRFX_SAADC_EVT_DONE ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="13562" url="~/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings/285022#285022"]I suggest you read both the prod spec and the driver implementations if you want to understand how the saadc works.[/quote]
&lt;p&gt;I have read it but not all of it and it does not make me an expert yet, there is still much clarifications to be given even after reading data sheet cause there is not enough guidance regarding programing and working with the SDK to my humble opinion, this is why i also seek for help in the forum&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/285022?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 11:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef5e22ed-8474-469e-bbdf-17b43ee9b0c7</guid><dc:creator>haakonsh</dc:creator><description>[quote user="ziv123"]so if i put the &amp;quot;SAMPLES_IN_BUFFER = 4 &amp;quot; this means i will get the &amp;quot;NRFX_SAADC_EVT_DONE&amp;quot; only after 4 sampling of the 2 channels ? or maybe i need to define one buffer with 8 bytes in it instead of 2 buffers of 4 ? pretty sure the issue is not clear for me as you can see by my questions i don&amp;#39;t really get how this works yet, sorry for that .. hope you help me with that[/quote]
&lt;p&gt;&amp;nbsp;Yes you need a buffer size of 8 samples for 2 channels.&amp;nbsp;&lt;/p&gt;
[quote user="ziv123"]also, what does the following function do in the nrf event handler when receiving an &amp;quot;&lt;span&gt;NRFX_SAADC_EVT_DONE&amp;quot;&amp;nbsp;&lt;/span&gt; even[/quote]
&lt;p&gt;&amp;nbsp;It prepares the current buffer to be used again for the next iteration. The driver alternates&amp;nbsp;2 buffers.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I suggest you read both the prod spec and the driver implementations if you want to understand how the saadc works.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/285005?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 10:40:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d11ac0a-84aa-4d89-8024-65b5673de673</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Haakonsh&lt;/p&gt;
&lt;p&gt;i don&amp;#39;t need to service the BLE at the same time. i sample for a few minutes and then i send, via BLE, all the sampled data (not just those 2 adc channels) and then go to sleep, that is the sequence. however, the adc sampling on both channels needs to be very accurate and continues as possible, if i calculate every 50ms then i have 6.4Kbyte of data to average, then process and then send to the sRAM via QSPI, i am afraid i might loos/overwrite sampled data if i can not complete all the mentioned procedure before the buffer is filled again&lt;/p&gt;
&lt;p&gt;so i can&amp;#39;t see how that approach is better&lt;/p&gt;
&lt;p&gt;could you replay to the questions i raised in the message you replied to ?&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284989?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 10:06:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca0a73c4-d3c9-49b2-8455-027baa45277c</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What I&amp;#39;m trying to say is that if you process your samples every 50ms you will have more than enough time to service the BLE stack at the same time, instead of every 125µs (4 samples @ 32kHz).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284963?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 09:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c88a9828-76ad-48b6-91e2-288fc0eed42c</guid><dc:creator>ziv123</dc:creator><description>[quote userid="13562" url="~/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings/284941#284941"]Why can&amp;#39;t you fill a large buffer and then run averaging? Do you have a latency-requirement?&amp;nbsp;[/quote]
&lt;p&gt;if you refer to the buffer filled by the eDMA in RAM then .. every second i have 32000 values of 4 bytes (2 values of 16 bits) if i run the sense sequence for 2 minutes i need about 16Mbyte of RAM, as fat as i know there is 256kb ram and 1Mb flash so my plane is to reduce it by averaging 4 reading first and then after some processing transfer it to an sRAM via QSPI (me next stage)&lt;/p&gt;
[quote userid="13562" url="~/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings/284941#284941"]You will get an&amp;nbsp;NRFX_SAADC_EVT_DONE&amp;nbsp;when the buffer is filled. One buffer will contain samples from each enabled channel, see&amp;nbsp;&lt;a title="EasyDMA" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22_3#saadc_easydma"&gt;EasyDMA&lt;/a&gt;&amp;nbsp;Fig 5 and 6&amp;nbsp;for examples of the buffer&amp;#39;s memory map.&amp;nbsp;[/quote]
&lt;p&gt;i looked for the mentioned RESULT.MAXCNT in the saadc example and i could not find it to understand where it is defined or what value it holds, same for the RESULT.PTR that&amp;#39;s about the data sheet ,&lt;/p&gt;
&lt;p&gt;but still, just to make sure i understand... if the following is my saadc_init function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
#define SAMPLES_IN_BUFFER 4

static const nrf_drv_timer_t m_timer = NRF_DRV_TIMER_INSTANCE(0);
static nrf_saadc_value_t     m_buffer_pool[2][SAMPLES_IN_BUFFER];
static nrf_ppi_channel_t     m_ppi_channel;
static uint32_t              m_adc_evt_counter;


void saadc_init(void)
{
    ret_code_t err_code;
    nrf_drv_saadc_config_t saadc_config;
    nrf_saadc_channel_config_t channel_config0;

    //Configure SAADC
    saadc_config.resolution = NRF_SAADC_RESOLUTION_14BIT;       //Set SAADC resolution to 12-bit. This will make the SAADC output values from 0 (when input voltage is 0V) to 2^12=2048 (when input voltage is 3.6V for channel gain setting of 1/6).
    saadc_config.oversample = NRF_SAADC_OVERSAMPLE_DISABLED;    //DIABLED - //Set oversample to 4x. This will make the SAADC output a single averaged value when the SAMPLE task is triggered 4 times.
    saadc_config.interrupt_priority = APP_IRQ_PRIORITY_LOW;     //Set SAADC interrupt to low priority.
    saadc_config.low_power_mode = NRFX_SAADC_CONFIG_LP_MODE;
	
    //Configure SAADC channel
    channel_config0.reference = NRF_SAADC_REFERENCE_INTERNAL;      //Set internal reference of fixed 0.6 volts
    channel_config0.gain = NRF_SAADC_GAIN1_6;                      //Set input gain to 1/6. The maximum SAADC input voltage is then 0.6V/(1/6)=3.6V. The single ended input range is then 0V-3.6V
    channel_config0.acq_time = NRF_SAADC_ACQTIME_10US;             //Set acquisition time. Set low acquisition time to enable maximum sampling frequency of 200kHz. Set high acquisition time to allow maximum source resistance up to 800 kohm, see the SAADC electrical specification in the PS. 
    channel_config0.mode = NRF_SAADC_MODE_SINGLE_ENDED;            //Set SAADC as single ended. This means it will only have the positive pin as input, and the negative pin is shorted to ground (0V) internally.
    channel_config0.pin_n = NRF_SAADC_INPUT_DISABLED;              //Since the SAADC is single ended, the negative pin is disabled. The negative pin is shorted to ground internally.
    channel_config0.resistor_p = NRF_SAADC_RESISTOR_DISABLED;      //Disable pullup resistor on the input pin
    channel_config0.resistor_n = NRF_SAADC_RESISTOR_DISABLED;        
    channel_config0.burst = NRF_SAADC_BURST_ENABLED;
    //nrf_saadc_channel_config_t channel_config_0 = NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);    

    err_code = nrf_drv_saadc_init(&amp;amp;saadc_config, saadc_callback);
    APP_ERROR_CHECK(err_code);

    channel_config0.pin_p = NRF_SAADC_INPUT_AIN0; // TBD WRITE SOME NAME 
    err_code = nrf_drv_saadc_channel_init(0, &amp;amp;channel_config0);
    APP_ERROR_CHECK(err_code);

    channel_config0.pin_p = NRF_SAADC_INPUT_AIN1;
    err_code = nrf_drv_saadc_channel_init(1, &amp;amp;channel_config0);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;so if i put the &amp;quot;SAMPLES_IN_BUFFER = 4 &amp;quot; this means i will get the &amp;quot;NRFX_SAADC_EVT_DONE&amp;quot; only after 4 sampling of the 2 channels ? or maybe i need to define one buffer with 8 bytes in it instead of 2 buffers of 4 ? pretty sure the issue is not clear for me as you can see by my questions i don&amp;#39;t really get how this works yet, sorry for that .. hope you help me with that&lt;/p&gt;
&lt;p&gt;also, what does the following function do in the nrf event handler when receiving an &amp;quot;&lt;span&gt;NRFX_SAADC_EVT_DONE&amp;quot;&amp;nbsp;&lt;/span&gt; event&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_drv_saadc_buffer_convert(p_event-&amp;gt;data.done.p_buffer, SAMPLES_IN_BUFFER);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284941?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 07:56:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9717507d-072d-4d80-a5e4-f8c39567c115</guid><dc:creator>haakonsh</dc:creator><description>[quote user="ziv123"]&lt;p&gt;how can i know to take the value sampled for each channel ? will it be&amp;nbsp;&amp;nbsp;p_event-&amp;gt;data.done.p_buffer[0] for channel 0 and&amp;nbsp;p_event-&amp;gt;data.done.p_buffer[1] for channel 1 ?&lt;/p&gt;
&lt;p&gt;or there will be an EVENT DONE for each channel ?&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;You will get an&amp;nbsp;NRFX_SAADC_EVT_DONE&amp;nbsp;when the buffer is filled. One buffer will contain samples from each enabled channel, see&amp;nbsp;&lt;a title="EasyDMA" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22_3#saadc_easydma"&gt;EasyDMA&lt;/a&gt;&amp;nbsp;Fig 5 and 6&amp;nbsp;for examples of the buffer&amp;#39;s memory map.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="ziv123"]&lt;p&gt;not sure what you meant by that, i want to sample the 2 channels at 32KHz rate for some time simultaneously i create my own oversampling i want to average the added values of each 4 samples (of both channels) i average the 4 readings of channel 0 and then averaging the 4 samples of channel 1 (so i actually gat 8KHz of my own oversampled (i can&amp;#39;t use the built in oversampling mechanism cause it oversample channel 0 and then oversample channel 1 and so i get some time shift of sampled values)&lt;/p&gt;
&lt;p&gt;the BLE will be operational only after some defined time (several minutes) of sampling at the above rate is done , hope my goals are clearer now&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i will try to explain my goal better, i want sampling rate of 32khz, of 2 channels but i want cpu intervention&lt;/p&gt;
&lt;p&gt;(i guess it starts at : &amp;quot;void saadc_callback(nrf_drv_saadc_evt_t const * p_event)&amp;quot;&amp;nbsp; ) only after 4 sampling event took place, so i am also looking for a way to get some interrupt from eDMA or something after 4x2 transffers of values where made to ram (also need to know where they are) , then cpu start to work to average the 4 saved sampled values of each channel, and then save the 2 average values (for ch0 and ch1).&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;hope my procedure is clearer now maybe it will be easier to guide me as to how to achieve it&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Why can&amp;#39;t you fill a large buffer and then run averaging? Do you have a latency-requirement?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284805?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 13:48:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64941d57-022a-423f-a0f3-e6adfac21207</guid><dc:creator>ziv123</dc:creator><description>[quote userid="13562" url="~/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings/284790#284790"]All enabled SAADC channels will be sampled once, in succession, starting with the lowest channel number, for each triggered SAMPLE task.[/quote]
&lt;p&gt;so i get one EVENT DONE for both channels ?&lt;/p&gt;
&lt;p&gt;how can i know to take the value sampled for each channel ? will it be&amp;nbsp;&amp;nbsp;p_event-&amp;gt;data.done.p_buffer[0] for channel 0 and&amp;nbsp;p_event-&amp;gt;data.done.p_buffer[1] for channel 1 ?&lt;/p&gt;
&lt;p&gt;or there will be an EVENT DONE for each channel ?&lt;/p&gt;
&lt;p&gt;in the saadc example only one channel is configured so i am not sure about the write way to configure and sample values of 2 channels, some guidance will be blessed&lt;/p&gt;
[quote userid="13562" url="~/f/nordic-q-a/69436/nrf52840-saadc-configuration-with-easydma-interrupt-after-x-samplings/284790#284790"] If you can use much larger buffers than 4 samples then you will be fine with BLE.[/quote]
&lt;p&gt;not sure what you meant by that, i want to sample the 2 channels at 32KHz rate for some time simultaneously i create my own oversampling i want to average the added values of each 4 samples (of both channels) i average the 4 readings of channel 0 and then averaging the 4 samples of channel 1 (so i actually gat 8KHz of my own oversampled (i can&amp;#39;t use the built in oversampling mechanism cause it oversample channel 0 and then oversample channel 1 and so i get some time shift of sampled values)&lt;/p&gt;
&lt;p&gt;the BLE will be operational only after some defined time (several minutes) of sampling at the above rate is done , hope my goals are clearer now&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i will try to explain my goal better, i want sampling rate of 32khz, of 2 channels but i want cpu intervention&lt;/p&gt;
&lt;p&gt;(i guess it starts at : &amp;quot;void saadc_callback(nrf_drv_saadc_evt_t const * p_event)&amp;quot;&amp;nbsp; ) only after 4 sampling event took place, so i am also looking for a way to get some interrupt from eDMA or something after 4x2 transffers of values where made to ram (also need to know where they are) , then cpu start to work to average the 4 saved sampled values of each channel, and then save the 2 average values (for ch0 and ch1).&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;hope my procedure is clearer now maybe it will be easier to guide me as to how to achieve it&lt;/p&gt;
&lt;p&gt;hope to read from you soon&amp;nbsp;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284790?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 13:24:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a6d92e1-5079-48fc-b2a1-775521fce35d</guid><dc:creator>haakonsh</dc:creator><description>[quote user="ziv123"]so i found out that instead of using the &amp;quot;nrf_drv_timer_us_to_ticks()&amp;quot; , i can just put the value 500 assuming the default prescalar is 16MHz. pleas correct me if i am wrong .[/quote]
&lt;p&gt;&amp;nbsp;Yeah that&amp;#39;s right.&amp;nbsp;&lt;/p&gt;
[quote user="ziv123"]is defined for one channel, so how can i set that both channels will be sampled one after the other each timer event ?[/quote]
&lt;p&gt;&amp;nbsp;All enabled SAADC channels will be sampled once, in succession, starting with the lowest channel number, for each triggered SAMPLE task.&amp;nbsp;&lt;/p&gt;
[quote user="ziv123"]also, in the saadc event handler where is the attention to which sample is read and where is the value saved ?[/quote]
&lt;p&gt;&amp;nbsp;It&amp;#39;s stored in the buffer who&amp;#39;s address was last used. See the SAADC example for use.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The SoftDevice Requires TIMER0, and also has execution priority. If you can use much larger buffers than 4 samples then you will be fine with BLE. When the RADIO peripheral is running the SAADC accuracy is a tiny bit lower.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]if i use app_timer as the RTC timer for the saadc, does it involves the CPU ?, can it use ppi? (the name &amp;quot;app&amp;quot; makes me suspicious :) ) and is it a good solution for 32MHz sampling rate or is it to fit ?[/quote]
&lt;p&gt;The app_timer does use an RTC peripheral, but it can not be used with PPI. For that you need to use the RTC driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284774?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 12:44:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a002c85b-e53c-4a54-a593-d670377386cc</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi haakonsh&amp;nbsp;&lt;/p&gt;
&lt;p&gt;so i found out that instead of using the &amp;quot;nrf_drv_timer_us_to_ticks()&amp;quot; , i can just put the value 500 assuming the default prescalar is 16MHz. pleas correct me if i am wrong .&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;how ever, i want to check 2 channels every 31.25 microsec (which is 32KHz) with the saadc and i see that the&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_drv_timer_extended_compare(&amp;amp;m_timer, NRF_TIMER_CC_CHANNEL0, TICS_FOR_32KHZ, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true); //false);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;is defined for one channel, so how can i set that both channels will be sampled one after the other each timer event ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;also, in the saadc event handler where is the attention to which sample is read and where is the value saved ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void saadc_callback(nrf_drv_saadc_evt_t const * p_event)
{
    if (p_event-&amp;gt;type == NRF_DRV_SAADC_EVT_DONE)
    {...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;p.s. i am referring to the sdk example&amp;nbsp;&lt;/p&gt;
&lt;p&gt;last question for now is that in the future a ble will be implemented to the system, it will not work at the same time with the saadc but is there some timers issue i need to consider when adding softdevice ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284727?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 09:50:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1bb79f0-4202-421e-b755-280fc3397049</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;also, does the timer configured as default in the saadc example is the HFCLOCK ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const nrf_drv_timer_t m_timer = NRF_DRV_TIMER_INSTANCE(0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;basically, since i&amp;nbsp; need sampling at accurate 32KHz, the LOW FCLOCK is not suck a good solution cause according to data sheet it counts 32.768KHz and not 32.000KHz&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284717?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 09:33:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2c83a9f-4db4-496d-9e12-fdbb9d2621db</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;KHz, my mistake&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC configuration with easyDMA interrupt after x samplings</title><link>https://devzone.nordicsemi.com/thread/284695?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 08:37:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2571c37c-01c9-4814-8370-7652d943c5f9</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Do you mean &lt;strong&gt;k&lt;/strong&gt;Hz or &lt;strong&gt;M&lt;/strong&gt;Hz?&lt;br /&gt;I ask because the SAADC has a max sample rate of 200ksps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>