<?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 Values ofsett.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119972/adc-values-ofsett</link><description>Hello, 
 
 We have a sensor with 2 ADCs inputs meauring identical LMT70s on the board. With one of our older firmwares we get the accurate valudes of 22deg or so on both channels. But in intergrating nusim the tempratures seems to have ofssets of 5-10</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Mar 2025 08:27:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119972/adc-values-ofsett" /><item><title>RE: ADC Values ofsett.</title><link>https://devzone.nordicsemi.com/thread/528981?ContentTypeID=1</link><pubDate>Wed, 26 Mar 2025 08:27:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f39bd55d-b736-43b7-b4ee-118e3e2de0d2</guid><dc:creator>sawaiz</dc:creator><description>&lt;p&gt;Ok, glad to see its nothing basic I missed. I am going to build a minimal example and see if I can reproduce the error. It might be some issue from the codebase being moved around from diffrent SDK versions and legacy code or some config or overlay error that is inherited and not visible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Values ofsett.</title><link>https://devzone.nordicsemi.com/thread/528920?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2025 18:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e654c1d-35a4-4250-824c-29d0f43f7f61</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello Sawaiz,&lt;/p&gt;
&lt;p&gt;I am honestly lost here. Without&amp;nbsp;narrowing down the issue, I am afraid I don&amp;#39;t even have a starting point to guess what could be wrong at all.&lt;/p&gt;
&lt;p&gt;The fact that swapping channel ID fixes it makes no sense either...&lt;/p&gt;
&lt;p&gt;If I understand correctly, you are using the same configurations for both channels, right? Could you please dump all values of all fields of the ADC devices to see if there is any abnormality?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Values ofsett.</title><link>https://devzone.nordicsemi.com/thread/528660?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2025 14:27:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bfe8f75-ff23-4fdf-916c-b74035f97917</guid><dc:creator>sawaiz</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I was migrating from a codebase that used a phsyical sim to one that used the nuSIM impletation by telekom. There was a lot ofchanges involved in the config and TFM portion so I couldnt pinpoint what changes caused the issue.&lt;br /&gt;&lt;br /&gt;In my testing I found out that somehow swaping the &amp;quot;.channel_id=0&amp;quot; between the two channels but not the &amp;quot;.input_positive = SAADC_CH_PSELN_PSELN_AnalogInput1&amp;quot; makes both values be around 25 degrees. Everything works properly this way, becasue I aslo swapped the BIT(1) and BIT(0) values to make make the two sensors match. But I still dont like the channels mismatching in the code.&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Init ADC vars
static const struct device *adc_dev = DEVICE_DT_GET(DT_NODELABEL(adc));  // ADC Node defined in the .dts file
int16_t air_adc_buffer[1];
int16_t pipe_adc_buffer[1];

struct adc_sequence pipeTempSeq = {.channels = BIT(1),
                                   .buffer = pipe_adc_buffer,
                                   .buffer_size = sizeof(pipe_adc_buffer),
                                   .resolution = 12,
                                   .calibrate = true,
                                   .oversampling = SAADC_OVERSAMPLE_OVERSAMPLE_Over64x};

struct adc_sequence airTempSeq = {.channels = BIT(0),
                                  .buffer = air_adc_buffer,
                                  .buffer_size = sizeof(air_adc_buffer),
                                  .resolution = 12,
                                  .calibrate = true,
                                  .oversampling = SAADC_OVERSAMPLE_OVERSAMPLE_Over64x};

// ADC0 Pipe ADC Channel
struct adc_channel_cfg adc0 = {
    .gain = ADC_GAIN_1_2,                                 // 0.2x input multiplier
    .reference = ADC_REF_INTERNAL,                        // 0.6V Internal refrence
    .acquisition_time = ADC_ACQ_TIME_DEFAULT,             // 0.6V / 0.5 input gain = 0-1.2V Range
    .channel_id = 1,                                      // Channel 0 for pipe
    .input_positive = SAADC_CH_PSELN_PSELN_AnalogInput0,  // Analog input 0 for pipe
    .differential = SAADC_CH_CONFIG_MODE_SE,
};

// ADC1 Air ADC Channel
struct adc_channel_cfg adc1 = {
    .gain = ADC_GAIN_1_2,                                 // 0.2x input multiplier
    .reference = ADC_REF_INTERNAL,                        // 0.6V Internal refrence
    .acquisition_time = ADC_ACQ_TIME_DEFAULT,             // 0.6V / 0.5 input gain = 0-1.2V Range
    .channel_id = 0,                                      // Channel 1 for air
    .input_positive = SAADC_CH_PSELN_PSELN_AnalogInput1,  // Analog input 1 for air
    .differential = SAADC_CH_CONFIG_MODE_SE,
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I was recalibrationg every measurement, but the ofsett calibarion seemed to hang forever and never return. I don&amp;#39;t think this is a issue since the diffrence between the values is so large, and swapping the channel ids only (no other compbination changes anything) makes the values be correct and respond correctly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Sawaiz&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Values ofsett.</title><link>https://devzone.nordicsemi.com/thread/528273?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 17:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f821753-8cdc-4000-b977-3cf5f26538f1</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello Sawaiz,&lt;/p&gt;
&lt;p&gt;Could you give more details in the difference between the setup that works better vs one that works worse? Do I understand right that you have an eSim activated?&lt;/p&gt;
&lt;p&gt;How often are you recalibrating the SAADC?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>