<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: S32K144 ADC Accuracy Problem in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1353860#M12410</link>
    <description>&lt;P&gt;Hi&amp;nbsp;ldj979, Please check the voltage of VREFH. Make sure the value match the #define ADC_VREFH 5.0f. I did not find any obvious errors in your configuration. Have you try to measure another voltage signal? (RAD&amp;lt;5kΩ) Is the ADC conversion result still inaccurate?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table 40. 12-bit ADC operating conditions.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158825i5AFE359A94958C93/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table 40. 12-bit ADC operating conditions.png" alt="Table 40. 12-bit ADC operating conditions.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Analog source resistance match.png" style="width: 738px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158826iE5670B362AF0B178/image-size/large?v=v2&amp;amp;px=999" role="button" title="Analog source resistance match.png" alt="Analog source resistance match.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 03:58:58 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2021-10-12T03:58:58Z</dc:date>
    <item>
      <title>S32K144 ADC Accuracy Problem</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1353661#M12407</link>
      <description>&lt;P&gt;Dear Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having an accuracy problem reading the voltage value using the adc of the s32k144, so I have a question.&lt;/P&gt;&lt;P&gt;I used an op amp on the front to read a voltage of around 240.31mV.&lt;/P&gt;&lt;P&gt;Two points were measured with a multimeter.&lt;/P&gt;&lt;P&gt;1. When I measured pin 1 of the opamp side, I read 240.31mV voltage.&lt;/P&gt;&lt;P&gt;2. When I measured ADC0 13 on pin 45 of s32k144 MCU, I read 240.31mV voltage.&lt;/P&gt;&lt;P&gt;I read the ADC value using S32DS SDK, but the value is incorrect.&lt;/P&gt;&lt;P&gt;I am attaching a code and picture of setup.&lt;/P&gt;&lt;P&gt;What's wrong?&lt;/P&gt;&lt;P&gt;#############################################################&lt;/P&gt;&lt;P&gt;/* Including necessary module. Cpu.h contains other modules needed for compiling.*/&lt;BR /&gt;#include "Cpu.h"&lt;/P&gt;&lt;P&gt;volatile int exit_code = 0;&lt;/P&gt;&lt;P&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;BR /&gt;#include "stdint.h"&lt;/P&gt;&lt;P&gt;#define ADC_INSTANCE 0UL&lt;BR /&gt;#define ADC_CHN 13U&lt;BR /&gt;#define ADC_VREFH 5.0f&lt;BR /&gt;#define ADC_VREFL 0.0f&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;/* Write your local variable definition here */&lt;/P&gt;&lt;P&gt;uint16_t adcRawValue;&lt;BR /&gt;uint16_t adcMax;&lt;BR /&gt;float adcValue = 0.0f;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;adcMax = (uint16_t) (1 &amp;lt;&amp;lt; 12);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Write your code here */&lt;BR /&gt;/* For example: for(;;) { } */&lt;/P&gt;&lt;P&gt;CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,&lt;BR /&gt;g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;DEV_ASSERT(PackV_ADC_ConvConfig0.channel == ADC_CHN);&lt;/P&gt;&lt;P&gt;ADC_DRV_ConfigConverter(ADC_INSTANCE, &amp;amp;PackV_ADC_ConvConfig0);&lt;BR /&gt;ADC_DRV_AutoCalibration(ADC_INSTANCE);&lt;/P&gt;&lt;P&gt;while(1)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* Configure ADC channel and software trigger a conversion */&lt;BR /&gt;ADC_DRV_ConfigChan(ADC_INSTANCE, 0U, &amp;amp;PackV_ADC_ChnConfig0);&lt;BR /&gt;/* Wait for the conversion to be done */&lt;BR /&gt;ADC_DRV_WaitConvDone(ADC_INSTANCE);&lt;/P&gt;&lt;P&gt;/* Store the channel result into a local variable */&lt;BR /&gt;ADC_DRV_GetChanResult(ADC_INSTANCE, 0U, &amp;amp;adcRawValue);&lt;/P&gt;&lt;P&gt;/* Process the result to get the value in volts */&lt;BR /&gt;adcValue = ((float) adcRawValue / adcMax) * (ADC_VREFH - ADC_VREFL);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OSIF_TimeDelay(1000);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;/*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;BR /&gt;/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;#ifdef PEX_RTOS_START&lt;BR /&gt;PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */&lt;BR /&gt;#endif&lt;BR /&gt;/*** End of RTOS startup code. ***/&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;for(;;) {&lt;BR /&gt;if(exit_code != 0) {&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return exit_code;&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;BR /&gt;} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;######################################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error print&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="problem1.PNG" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158799i2F4090AFA9997CD7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="problem1.PNG" alt="problem1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="problem2.PNG" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158800iC6680B94547B6585/image-size/medium?v=v2&amp;amp;px=400" role="button" title="problem2.PNG" alt="problem2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="problem3.PNG" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158801i7FF7BD99F79BB879/image-size/medium?v=v2&amp;amp;px=400" role="button" title="problem3.PNG" alt="problem3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;DJ LEE&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 17:07:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1353661#M12407</guid>
      <dc:creator>ldj979</dc:creator>
      <dc:date>2021-10-11T17:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 ADC Accuracy Problem</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1353664#M12408</link>
      <description>&lt;P&gt;The schematic diagram of the front part is also attached.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 17:10:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1353664#M12408</guid>
      <dc:creator>ldj979</dc:creator>
      <dc:date>2021-10-11T17:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 ADC Accuracy Problem</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1353860#M12410</link>
      <description>&lt;P&gt;Hi&amp;nbsp;ldj979, Please check the voltage of VREFH. Make sure the value match the #define ADC_VREFH 5.0f. I did not find any obvious errors in your configuration. Have you try to measure another voltage signal? (RAD&amp;lt;5kΩ) Is the ADC conversion result still inaccurate?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table 40. 12-bit ADC operating conditions.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158825i5AFE359A94958C93/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table 40. 12-bit ADC operating conditions.png" alt="Table 40. 12-bit ADC operating conditions.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Analog source resistance match.png" style="width: 738px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158826iE5670B362AF0B178/image-size/large?v=v2&amp;amp;px=999" role="button" title="Analog source resistance match.png" alt="Analog source resistance match.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 03:58:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1353860#M12410</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2021-10-12T03:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 ADC Accuracy Problem</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1358645#M12503</link>
      <description>&lt;P&gt;Dear Robin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is RC filter necessary in front of the ADC pin of the s32k144?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;DJ LEE&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 12:36:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1358645#M12503</guid>
      <dc:creator>ldj979</dc:creator>
      <dc:date>2021-10-20T12:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 ADC Accuracy Problem</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1358647#M12504</link>
      <description>&lt;P&gt;Also, VREFH is stable.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 12:37:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1358647#M12504</guid>
      <dc:creator>ldj979</dc:creator>
      <dc:date>2021-10-20T12:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 ADC Accuracy Problem</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1359993#M12525</link>
      <description>&lt;P&gt;Whether RC filter is needed depends on whether there are glitches in the signal to be sampled.&lt;BR /&gt;In addition, please tell me whether the result of ADC sampling on-board POT R13 is accurate.&lt;BR /&gt;VREFH is stable. Did you measure the voltage and ensure it was 5V?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 09:04:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1359993#M12525</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2021-10-22T09:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 ADC Accuracy Problem</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1392357#M13428</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I solved it by attaching a pull-up resistor on the front end. Thank you for answer&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 01:56:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-ADC-Accuracy-Problem/m-p/1392357#M13428</guid>
      <dc:creator>ldj979</dc:creator>
      <dc:date>2021-12-28T01:56:38Z</dc:date>
    </item>
  </channel>
</rss>

