<?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>SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design</link><description>Hello, I am working on a new hardware design of analog sensors, which I want to sample their reading using SAADC. I use nrf52832 PCA10040 DK, and softdevice s132 for sending data over BLE. The thing is that I have been trying for a while to read properly</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Aug 2025 09:09:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design" /><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/546011?ContentTypeID=1</link><pubDate>Tue, 19 Aug 2025 09:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ace927fd-b231-465c-bfd9-9662028717a6</guid><dc:creator>DimitraN</dc:creator><description>[quote userid="128023" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/546009"]&lt;blockquote class="quote"&gt;&lt;div class="quote-user"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/545785"&gt;hmolesworth said:&lt;/a&gt;&lt;/div&gt;&lt;div class="quote-content"&gt;&lt;p&gt;To simplify the equations the floating Vn drives could be driven high to parallel the measured resistor or driven low to parallel the 12k net pulldown resistance. For V1:A3 measuring S6 driving V2 and V3 high S6 would then be more simply seen as:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;em&gt;S6 || S7 || S8&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;V1, V2 and V3 outputs should be High-Drive H0H1 to reduce the output pin FET series resistance; Standard-Drive L0L1 is something like 160 Ohm and H0H1 is something like 35 Ohm.&lt;/p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;I will try this and come back at you&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;I tried this but didnt get good results, except if I did something wrong.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;To read S6 (V1 and A3) I configure the pins as follows:&amp;nbsp;&lt;br /&gt;&lt;br /&gt; &lt;pre class="ui-code" data-mode="text"&gt;nrf_gpio_cfg(V2, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(V3, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg_output(V1);
nrf_gpio_pin_set(V1);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the same configuration is made for every S0-S8&amp;nbsp;&lt;br /&gt;&lt;br /&gt;but I get :&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;[S0, S3, S6]&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;[S1, S4, S7]&lt;/span&gt;&lt;br /&gt;&lt;span&gt;[S2, S5, S8]&amp;nbsp; &amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1755594485026v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/546009?ContentTypeID=1</link><pubDate>Tue, 19 Aug 2025 08:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e69d9783-ca1c-46f3-9042-1fd8a3986371</guid><dc:creator>DimitraN</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="65515" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/545711"]Edit all the functions like&amp;nbsp;&lt;em&gt;nrf_drv_saadc_channel_uninit()&lt;/em&gt; to also turn off the port pull-down[/quote]
&lt;p&gt;Yes I tried this but didn&amp;#39;t&amp;nbsp;help.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="65515" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/545711"]&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;em&gt;S6 || (S7 + ((S4+S3) || (S1+S0)))&amp;nbsp;|| (S8 + ((S5+S3) || &lt;/em&gt;&lt;em&gt;(S2+S0)))&lt;/em&gt;&lt;/span&gt;[/quote]
&lt;p&gt;Could you please by the way explain to me how did you calculate this formula ? How/why the rest resistors affect the one that is about to be measured, even if we have &amp;quot;disconnected&amp;quot; the rest of the pins (Vx and saadc pins)?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="65515" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/545785"]&lt;p&gt;To simplify the equations the floating Vn drives could be driven high to parallel the measured resistor or driven low to parallel the 12k net pulldown resistance. For V1:A3 measuring S6 driving V2 and V3 high S6 would then be more simply seen as:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;em&gt;S6 || S7 || S8&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;V1, V2 and V3 outputs should be High-Drive H0H1 to reduce the output pin FET series resistance; Standard-Drive L0L1 is something like 160 Ohm and H0H1 is something like 35 Ohm.&lt;/p&gt;[/quote]
&lt;p&gt;I will try this and come back at you&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="65515" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/545785"]I&amp;#39;m assuming adding series schottky diodes is not an option?[/quote]
&lt;p&gt;It is an option, this is what I tried right now.. but I can do it with some constraints.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The grid is a ready-made sensor that I want to read, so the only points in the circuit where I can integrate something are at the black &amp;quot;X&amp;quot; below, which are the wires going to my electronics.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pastedimage1755592085104v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;I connected 1N5817 diodes at the points but with no effect.&amp;nbsp;&lt;br /&gt;Maybe I should try with MOSFET too?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/545785?ContentTypeID=1</link><pubDate>Fri, 15 Aug 2025 12:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd7be8cb-94ba-42b5-9039-538922202c6b</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;To simplify the equations the floating Vn drives could be driven high to parallel the measured resistor or driven low to parallel the 12k net pulldown resistance. For V1:A3 measuring S6 driving V2 and V3 high S6 would then be more simply seen as:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;em&gt;S6 || S7 || S8&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;V1, V2 and V3 outputs should be High-Drive H0H1 to reduce the output pin FET series resistance; Standard-Drive L0L1 is something like 160 Ohm and H0H1 is something like 35 Ohm.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m assuming adding series schottky diodes is not an option?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/545711?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2025 18:59:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e27f34f0-0f99-4087-869e-06d6523c1f5f</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;The pull-downs for both port io and SAADC must be turned off for the other two analogue channels when reading an analogue channel. For example for reading channel V2/A3 both V1 and V3 pins must be floated (inputs) and both A1 and A2 pins must have both port io and SAADC pull-downs turned off:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Uncomment all these
  //nrf_drv_saadc_channel_uninit(0);
  //nrf_drv_saadc_channel_uninit(2);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Edit all the functions like&amp;nbsp;&lt;em&gt;nrf_drv_saadc_channel_uninit()&lt;/em&gt; to also turn off the port pull-down&lt;/p&gt;
&lt;p&gt;Edit: Ah this will not work easily I&amp;#39;m afraid. I just looked at your updated schematic and see that the effective resistor is still affected by the other resistors. Instead of (say) measuring S6 using V1/A3 the measured value would be approximately:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;em&gt;S6 || (S7 + ((S4+S3) || (S1+S0)))&amp;nbsp;|| (S8 + ((S5+S3) || &lt;/em&gt;&lt;em&gt;(S2+S0)))&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; which explains why the measured value is higher than expected. S0 is less affected since it has the lowest resistance value.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Without knowing what the &amp;quot;resistors&amp;quot; (the analogue sensors) consist of, it is not clear whether this is simple to pre-calculate by applying the parallel resistor values in the formula; easier if only a single resistor changes value at a time.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/545475?ContentTypeID=1</link><pubDate>Wed, 13 Aug 2025 08:01:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f31afd2-2355-404d-8770-02ef29979bcb</guid><dc:creator>DimitraN</dc:creator><description>&lt;p&gt;The new circuit is&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1755071289501v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;The code is the same as above, where I enable one SAADC channel at a time for each column of resistors, first channel 1 for A1 and I set V1 output pin and drive it high to read S0. Then I set V1, V3 input and no pull and disconnect them, set V2 output and high to read S1, etc. When I finish with one column, I uninitialize channels and enable only channel 2 for A2 pin, and set V pins accordingly for S3, S4,S5 etc.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I have put RP resistors in the drawing which are the equivalent of the two parallel pull down resistors (of SAADC and internal of GPIO as you mentioned).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;As you said, with this drawing right now I should be able to read properly each resistor, so probably the fault is in my code. If you need more of my code please let me know..&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The results in the debugger are:&amp;nbsp;&lt;br /&gt;[S0, S3, S6]&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;[S1, S4, S7]&lt;br /&gt;[S2, S5, S8]&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1755071987355v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;while I expect (using 12k equivalent pull down resistor)&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1755072080883v3.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;I really appreciate your help, I have been struggling with this several hours.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/545414?ContentTypeID=1</link><pubDate>Tue, 12 Aug 2025 15:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb31cc19-c984-4620-8a22-be5bee8c8487</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Best if you upload the updated grid drawing and the code you are now testing with.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/545368?ContentTypeID=1</link><pubDate>Tue, 12 Aug 2025 11:59:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ae3b2ab-c562-4018-9954-0420a6254af9</guid><dc:creator>DimitraN</dc:creator><description>[quote userid="65515" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/543646"]However a simple modification would allow measurement of S3 to S8 with the same number of pins; break all connections to S3-S8 and wire similar to S0-S2 such that V1 directly drives S0, S3 and S6 (direct, not in a daisy-chain) which are measured by A1, A2 and A3 but for each measurement eg V2/A2 disable pulldowns on the other SAADC channels in this case A1 and A3 and float the drivers V1 and V3. Similar for S1, S4 and S7 and also for S2, S5 and S8[/quote]
&lt;p&gt;Hello again,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I created this circuit on my breadboard and I still cannot read the resistors properly. Can you find maybe the issue in my code? have you tested it that it works?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/545050?ContentTypeID=1</link><pubDate>Fri, 08 Aug 2025 11:55:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2a8edc1-e671-4b97-8b4c-a746a7493661</guid><dc:creator>DimitraN</dc:creator><description>[quote userid="65515" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/543646"]Not so for other than S0, S1 and S2; assuming the dots on the schematic are connections and not open switches.[/quote]
&lt;p&gt;So if I understand correctly I cannot achieve what I want with the current hardware connection of the sensors. Because for each row of the grid the previous resistors interfere - drop the voltage. e.g. I read S6, S0 and S3 drop the voltage even if I disconnect A1 and A2..&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="65515" url="~/f/nordic-q-a/123259/saadc-channel-interference-due-to-software-bad-configuration-or-hardware-design/543646"]Note also there are two pulldown resistors; the internal bias pulldown for the SAADC is 160k and the internal pulldown for an input pin is about 13k.[/quote]
&lt;p&gt;Thank you for this note! I hadn&amp;#39;t found this but I should have&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC channel interference due to software bad configuration or hardware design?</title><link>https://devzone.nordicsemi.com/thread/543646?ContentTypeID=1</link><pubDate>Fri, 25 Jul 2025 20:52:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47700542-a7ff-4c57-86c1-eaac3c580da8</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;&amp;quot;&lt;span&gt;&lt;em&gt;The idea is that if we disconnect every pin and set only V1 high and connect only A1 analog pin to the ADC, we will read the &amp;quot;signal&amp;quot; of the resistor S0 only without any interference of the rest.&lt;/em&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Not so for other than S0, S1 and S2; assuming the dots on the schematic are connections and not open switches.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note also there are two pulldown resistors; the internal bias pulldown for the SAADC is 160k and the internal pulldown for an input pin is about 13k. That second input pin pulldown is not documented to work on the pin in SAADC mode, though I believe it does work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  channel0_config.resistor_p = NRF_SAADC_RESISTOR_PULLDOWN; //Disable the 13k pulldown resistor. (Bypass resistor ladder).
actually:
  channel0_config.resistor_p = NRF_SAADC_RESISTOR_PULLDOWN; //Enable the 160k pulldown resistor. (Bypass resistor ladder).&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;V1 high, A1 pulled low by 160k||13k ==12k&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;V1 = (2^14)*(12k)/(12K+1K) = 16384*(12/13) = 15,124&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This only allows measurements of S0, S1 and S2. However a simple modification would allow measurement of S3 to S8 with the same number of pins; break all connections to S3-S8 and wire similar to S0-S2 such that V1 directly drives S0, S3 and S6 (direct, not in a daisy-chain) which are measured by A1, A2 and A3 but for each measurement eg V2/A2 disable pulldowns on the other SAADC channels in this case A1 and A3 and float the drivers V1 and V3. Similar for S1, S4 and S7 and also for S2, S5 and S8&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Better results can be obtained by using differential mode and measuring in both directions; I discuss this here:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/116914/seeking-more-information-on-nrf52833-adc-reference-and-buffers/516567"&gt;seeking-more-information-on-adc-reference-and-buffer-offset&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>