<?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>n52840 ADC channel setting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115552/n52840-adc-channel-setting</link><description>Hi Sir 
 I am using an example from NCS 2.6.0 and want to modify it to use ADC channel 6 (P0.30) to read voltage values, but I am unable to get the correct values. (When I flash the example using ADC channel 0, it reads the values correctly.) How should</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Oct 2024 14:21:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115552/n52840-adc-channel-setting" /><item><title>RE: n52840 ADC channel setting</title><link>https://devzone.nordicsemi.com/thread/506555?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2024 14:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c87977e-1565-4cd0-9ccb-17ed56edc66f</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]I am using an example from NCS 2.6.0 and want to modify it to use ADC channel 6 (P0.30) to read voltage values, but I am unable to get the correct values. (When I flash the example using ADC channel 0, it reads the values correctly.) How should I modify it? [/quote]
&lt;p&gt;&lt;span&gt;You need to add an overlay file for it.&amp;nbsp;For instance, to use AIN6 (P0.30) you can modify modules/hal/nordic/nrfx/samples/src\nrfx_saadc/boards/nrf52840dk_nrf52840.overlay that contains this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	zephyr,user {
		io-channels = &amp;lt;&amp;amp;adc 6&amp;gt;;
	};
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can add other configurations as needed.&amp;nbsp;Check out the example in &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-6-analog-to-digital-converter-adc/topic/exercise-1-interfacing-with-adc-using-zephyr-api/"&gt;this DevAcademy ADC course&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]Also, I want to continuously read the values rather than reading just once as in the example. Could you provide me with suggestions?[/quote]
&lt;p&gt;Check out&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/106042/restarting-nrfx-saadc-measurement-in-maximum-performance-mode"&gt; this post&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>