<?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>Using SAADC in nRF Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80685/using-saadc-in-nrf-connect-sdk</link><description>Hi 
 I have been experimenting with ncs recently, just trying different things out. 
 I&amp;#39;m making an application based on the following example (Which is basically code from one of the Nordic&amp;#39;s guides, which uses SAADC to control PWM output and with it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Oct 2021 16:24:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80685/using-saadc-in-nrf-connect-sdk" /><item><title>RE: Using SAADC in nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/334409?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2021 16:24:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94aa3a37-3a4d-4fd5-b4c7-d421ab3c5bd4</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote userid="91630" url="~/f/nordic-q-a/80685/using-saadc-in-nrf-connect-sdk/334405#334405"]&lt;p&gt;&lt;span&gt;Thank you very much for your help, this works.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And thank you for a detailed explanation!&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;No problem at all, Emir - I&amp;#39;m happy to help! :)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open another ticket if you should encounter any issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SAADC in nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/334405?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2021 15:21:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ba4d08d-0863-4ba8-9e3a-74d3487c69d2</guid><dc:creator>enukic</dc:creator><description>&lt;p&gt;Hi Karl&lt;/p&gt;
&lt;p&gt;I completely missed that #define. I thought I needed to use&amp;nbsp;&lt;em&gt;device_get_binding()&amp;nbsp;&lt;/em&gt;to get to the&amp;nbsp;&lt;em&gt;arduino_adc: &lt;/em&gt;&lt;span&gt;&lt;em&gt;analog-connector&amp;nbsp;&lt;/em&gt;from the device tree. I was trying something like:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define ADC_IN(i) DT_INST(i,ardunio_uno_adc)
#define ADC_1 ADC_IN(1)

const struct device *adc_dev;
adc_dev = device_get_binding(ADC_1);&lt;/pre&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I guess I still need some documentation reading.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you very much for your help, this works.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And thank you for a detailed explanation!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Emir&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SAADC in nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/334400?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2021 14:37:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5e36cef-7e93-4da6-93d5-836c6372dc2f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]Can anyone guide me through how can I set different AIN pin to be used(let&amp;#39;s say AIN4) in this example?[/quote]
&lt;p&gt;In this particular example you should be able to change the AIN pin to sample by changing the 15th line of main.c from:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN0&lt;/pre&gt;&lt;br /&gt;To&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN4&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]I still don&amp;#39;t understand how the whole device tree thing works, and I believe this would require some changes to the device tree.[/quote]
&lt;p&gt;Yes, the device tree is a structure to familiarize with in its own, but in essence it is what Zephyr draws from when you for example set CONFIG_UART=y in prj.conf - this will make Zephyr initialize the UART peripheral, using the default parameters gotten from the device tree. This way, each board can have its own device tree, with different default mappings and configurations, while all you have to do in Zephyr to make use of it is CONFIG_*=y.&lt;br /&gt;If this then needs reconfiguring or modification you will have to modify the device tree file directly.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to ask if any part of this should be unclear, or in the case that you&amp;#39;ve got any other questions!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SAADC in nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/334204?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 14:25:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3a62ab0-dfb5-4aa8-b9d8-c0459a840e68</guid><dc:creator>enukic</dc:creator><description>&lt;p&gt;Maybe I should also mention that the target board is nRF52840DK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>