<?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>Read one sample from ADC without timers.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56504/read-one-sample-from-adc-without-timers</link><description>I&amp;#39;m having trouble reading value from ADC. What I want is to read a sample and not set any timer, since I want to run it inside a timer itself and have the refreshed value. I want to read a sample and not fill a buffer because I need a value without being</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Jan 2020 14:04:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56504/read-one-sample-from-adc-without-timers" /><item><title>RE: Read one sample from ADC without timers.</title><link>https://devzone.nordicsemi.com/thread/229068?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2020 14:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c372a2b9-87d8-40cf-9f78-eb1e1da79a11</guid><dc:creator>Rafael Barrero</dc:creator><description>&lt;p&gt;Ok I retried and it works. My problem after your answer was that I defined an init function but I didn&amp;#39;t call it. Thanks for all.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read one sample from ADC without timers.</title><link>https://devzone.nordicsemi.com/thread/229054?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2020 13:30:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c73cbb63-4b11-45a4-ae7a-2e23c065440c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;It is not possible to initialize the SAADC driver itself in blocking mode, hence a callback is required to handle the events when event-driven sampling is used. As you can see, the callback is blank and will not be called in this sample application. You could pass &amp;#39;NULL&amp;#39; to the init function, but the driver will &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.0/drivers/src/nrfx_saadc.c#L206"&gt;assert in debug mode&lt;/a&gt; if no callback is provided.&lt;/p&gt;
&lt;p&gt;The change you proposed for using AIN4 is correct. I tested that this works with the code for P0.28.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read one sample from ADC without timers.</title><link>https://devzone.nordicsemi.com/thread/229039?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2020 13:05:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5db2cf49-26b2-467d-ac5b-fea48644f201</guid><dc:creator>Rafael Barrero</dc:creator><description>&lt;p&gt;Okay thanks, I&amp;#39;m trying to adapt to my code and see if works. I&amp;#39;m tryimg to understand your example and&amp;nbsp;my biggest doubt is about &amp;quot;saadc_callback&amp;quot;. Could you explain what purpose that function has?&lt;/p&gt;
&lt;p&gt;As a complementary question, I want to use ADC throught P0.28(supposed to be Analog Input 4).. How result the code? I tried changing&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrf_saadc_channel_config_t channel_config = NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;nrf_saadc_channel_config_t channel_config =&lt;br /&gt; NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN4);&lt;/p&gt;
&lt;p&gt;but not work.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you, best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read one sample from ADC without timers.</title><link>https://devzone.nordicsemi.com/thread/229018?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2020 12:10:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e531c08d-785c-4730-9d81-91bbd80af488</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The thread you linked is for the ADC in nRF51 series. It differs quite a bit from the SAADC in nRF52 series.&lt;/p&gt;
&lt;p&gt;I have created a minimal blocking SAADC example in SDK 16.0.0 that you can use for reference:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-730996c066744111af9687b80aa71dd7/saadc_5F00_simple_5F00_blocking_5F00_sdk_5F00_16.0.0.zip"&gt;devzone.nordicsemi.com/.../saadc_5F00_simple_5F00_blocking_5F00_sdk_5F00_16.0.0.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note that the SAADC will&amp;nbsp;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;always&lt;/em&gt; work in an event-driven way. The difference with blocking mode is that the function will busy loop inside the function until the sampling is done.&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>