<?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>ADC init problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67752/adc-init-problem</link><description>I have a question about ADC configuration。 If an ADC input is multiplexed in different ADC channels , is the ADC data still dependable? 
 for example, the init code is as below: 
 void user_saadc_init(void) { ret_code_t err_code; nrf_saadc_channel_config_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Nov 2020 09:21:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67752/adc-init-problem" /><item><title>RE: ADC init problem</title><link>https://devzone.nordicsemi.com/thread/278211?ContentTypeID=1</link><pubDate>Tue, 03 Nov 2020 09:21:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac843d2b-d843-46b7-a0c8-b4fdf3d7a364</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Peaker,&lt;/p&gt;
[quote user="peaker.zhang"]Can I change the number to 12 ?&amp;nbsp; &amp;nbsp;I want to use more channels.[/quote]
&lt;p&gt;Unfortunately no, regardless of that define the SAADC peripheral may only use up to eight channels, as specified in &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fsaadc.html&amp;amp;anchor=saadc_frontpage"&gt;the SAADC peripheral documentation&lt;/a&gt;. The channels are used to control the mux and sampling pin configuration.&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: ADC init problem</title><link>https://devzone.nordicsemi.com/thread/278170?ContentTypeID=1</link><pubDate>Tue, 03 Nov 2020 01:05:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45b392b4-7826-42b7-959b-d0075eac474a</guid><dc:creator>peaker2016</dc:creator><description>&lt;p&gt;HI Karl,&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1604364843870v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Can I change the number to 12 ?&amp;nbsp; &amp;nbsp;I want to use more channels.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Peaker&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC init problem</title><link>https://devzone.nordicsemi.com/thread/277757?ContentTypeID=1</link><pubDate>Fri, 30 Oct 2020 09:21:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d836061c-ea44-4836-9a33-e76fb29e6bbb</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Peaker,&lt;/p&gt;
[quote user="peaker.zhang"]I didn&amp;#39;t find any problems in my use. I just want to confirm it from you.[/quote]
&lt;p&gt;Oh, I understand. Thank you for clarifying!&lt;br /&gt;As far as I can see your proposed implementation should work just fine - but I urge you to add the APP_ERROR_CHECKS that I mentioned in my previous comment.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open a new ticket in the future if you should encounter any issues or questions.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC init problem</title><link>https://devzone.nordicsemi.com/thread/277703?ContentTypeID=1</link><pubDate>Fri, 30 Oct 2020 02:57:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bed5bf80-1f46-4e20-bcff-4407e78c0489</guid><dc:creator>peaker2016</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t find any problems in my use. I just want to confirm it from you.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Peaker&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC init problem</title><link>https://devzone.nordicsemi.com/thread/277617?ContentTypeID=1</link><pubDate>Thu, 29 Oct 2020 13:47:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aeee2e2-3553-4768-b3cf-db867d5515b9</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]If an ADC input is multiplexed in different ADC channels ,&amp;nbsp; is the ADC data still&amp;nbsp;&lt;span&gt;dependable?&lt;/span&gt;[/quote]
&lt;p&gt;I would think this should be no problem at all. The channels are multiplexed, as you said, so the pins will not actually be sampled at the same time either way.&lt;br /&gt;So, I do not see any reason why this should not work.&lt;br /&gt;Are you getting any unexpected behavior when you run this initialization? If so, what are you observing, and how is it different from what you would have expected?&lt;br /&gt;&lt;br /&gt;I notice that you do not perform an APP_ERROR_CHECK on every returned error code. You should make sure that &lt;em&gt;every&lt;/em&gt; returned error code is checked.&lt;br /&gt;&lt;br /&gt;For future reference, please use the &amp;quot;Insert -&amp;gt; Code&amp;quot; option when sharing code on the forum. This drastically increases readability.&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></channel></rss>