<?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>What is the EVENTDONE of SAADC oversampling?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67552/what-is-the-eventdone-of-saadc-oversampling</link><description>I&amp;#39;m trying to make an application which displays signal transferred via bluetooth. 
 To reduce computing time on the tablet, I want to apply oversampling in nRF52840. 
 The problem is that I&amp;#39;m not sure whether the NRF_DRV_SAADC_EVT_DONE means oversampled</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Oct 2020 10:03:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67552/what-is-the-eventdone-of-saadc-oversampling" /><item><title>RE: What is the EVENTDONE of SAADC oversampling?</title><link>https://devzone.nordicsemi.com/thread/276805?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 10:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5796146d-3363-4a6a-b73f-579613425b7c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The averaging is performed in the peripheral, before the result is written to the buffer. The buffer will only hold the 10 result samples, not all 40 samples used for averaging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the EVENTDONE of SAADC oversampling?</title><link>https://devzone.nordicsemi.com/thread/276767?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 02:06:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e0c934f-81c7-49cd-a632-7938ecb70200</guid><dc:creator>DL_November</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/67552/what-is-the-eventdone-of-saadc-oversampling/276566#276566"]To sum up, the result is ready for use when you get this event in the driver, all oversampling is completed.[/quote]
&lt;p&gt;Then, for the case of SAMPLES_IN_BUFFER = 10 and x4 oversampling, NRF_DRV_SAADC_EVT_DONE appears as averaged 10 values from the 40 samples are stored in the buffer, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the EVENTDONE of SAADC oversampling?</title><link>https://devzone.nordicsemi.com/thread/276566?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 08:20:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae199c71-2f09-4fcb-973a-c72f30133fbd</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is important to distinguish between the events generated by the peripheral (&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22_8#register.EVENTS_END"&gt;EVENTS_END&lt;/a&gt;/&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22_8#register.EVENTS_DONE"&gt;EVENTS_DONE&lt;/a&gt;/&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22_8#register.EVENTS_RESULTDONE"&gt;EVENTS_RESULTDONE&lt;/a&gt;), and the software events passed to the application from the driver (&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrf__drv__saadc.html#gad82628a6672665db12638527013c7093"&gt;NRF_DRV_SAADC_EVT_DONE&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;From the peripherals perspective, the DONE event means that a single sample is completed, but no result is yet ready if oversample is enabled. When the averaged result by the oversampling mechanism is ready, the peripheral will generate the RESULTDONE event, but at this point, the result is not yet transferred from the peripheral to the sample buffer in RAM. The result is first available in the RAM buffen when the END event is generated by the peripheral.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The naming of the software event from the driver may be a bit confusing, as the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrf__drv__saadc.html#gad82628a6672665db12638527013c7093"&gt;NRF_DRV_SAADC_EVT_DONE&lt;/a&gt;&amp;nbsp;event in actually &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.4/drivers/src/nrfx_saadc.c#L97-L127"&gt;triggered&lt;/a&gt; when the driver receives the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22_8#register.EVENTS_END"&gt;NRF_SAADC_EVENTS_END&lt;/a&gt;&amp;nbsp;event from the peripheral. To sum up, the result is ready for use when you get this event in the driver, all oversampling is completed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>