<?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: ADC Conversion time issue in S32K</title>
    <link>https://community.nxp.com/t5/S32K/ADC-Conversion-time-issue/m-p/2418361#M61309</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;DIV&gt;
&lt;P&gt;The ADC conversion-time equation is provided directly in S32K3 Reference Manual, section 60.3.18 "Conversion time". For your configuration (single channel, pre-sampling disabled, hardware averaging disabled), the conversion time can be calculated using that formula and the configured ADC clock.&lt;/P&gt;
&lt;P&gt;A few additional notes:&lt;/P&gt;
&lt;P&gt;1. Adc_Sar_Ip_DoCalibration() does not affect the timing of subsequent conversions. Calibration is executed during initialization and the calibration values are then used by the ADC hardware.&lt;/P&gt;
&lt;P&gt;2. The measured ~4 µs is not ADC conversion time only. Your measurement spans:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Adc_Sar_Ip_StartConversion()&lt;/LI&gt;
&lt;LI&gt;ADC sampling and conversion&lt;/LI&gt;
&lt;LI&gt;ADC interrupt generation&lt;/LI&gt;
&lt;LI&gt;NVIC interrupt latency&lt;/LI&gt;
&lt;LI&gt;RTD ISR processing&lt;/LI&gt;
&lt;LI&gt;Callback dispatch&lt;/LI&gt;
&lt;LI&gt;GPIO toggle operations&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Therefore, the measured pulse width includes both ADC hardware time and software overhead. It is expected to be noticeably larger than the conversion time calculated from the RM formula alone.&lt;/P&gt;
&lt;P&gt;3. To measure the ADC hardware conversion time more accurately, we can recommend below&lt;/P&gt;
&lt;DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Toggle the first GPIO immediately after Adc_Sar_Ip_StartConversion() returns. This removes most of the start-API execution time from the measured pulse.&lt;/LI&gt;
&lt;LI&gt;In the ADC interrupt handler, toggle GPIO as early as possible, before calling the configured notification callback. This separates interrupt entry from callback-dispatch overhead.&lt;/LI&gt;
&lt;LI&gt;For the lowest GPIO software overhead, temporarily use a direct SIUL2 GPIO register write instead of Siul2_Dio_Ip_TogglePins().&lt;/LI&gt;
&lt;LI&gt;Alternatively, poll the ADC end-of-chain status flag and toggle the GPIO immediately when the hardware flag becomes set. This excludes NVIC and callback overhead, although polling-loop and GPIO-write latency remain.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;So, based on the information provided, the ~4 µs measurement is most likely dominated by the complete software/interrupt path rather than the ADC conversion itself.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 05 Oct 2026 07:54:50 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2026-10-05T07:54:50Z</dc:date>
    <item>
      <title>ADC Conversion time issue</title>
      <link>https://community.nxp.com/t5/S32K/ADC-Conversion-time-issue/m-p/2418319#M61305</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello NXP Support,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am working with an S32K312 MCU using S32 Design Studio and RTD drivers, and I am trying to understand the actual conversion timing of the SAR ADC for a single-channel normal conversion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My setup is:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;MCU: S32K312&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Core clock: 120 MHz&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;ADC functional clock: 120 MHz&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;ADC mode: Normal conversion&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Number of channels: 1&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Pre-sampling: Disabled&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Sampling time: 33 ADC clock cycles&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Conversion time used in my calculation: 48 ADC clock cycles&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Hardware averaging: Disabled for this test&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;End-of-chain notification/interrupt enabled&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;The relevant code is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;int main(void) { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Clock_Ip_Init(&amp;amp;Clock_Ip_aClockConfig[0]); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IntCtrl_Ip_Init(&amp;amp;IntCtrlConfig_0); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IntCtrl_Ip_EnableIrq(ADC0_IRQn); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Siul2_Port_Ip_Init( NUM_OF_CONFIGURED_PINS_PortContainer_0_BOARD_InitPeripherals, g_pin_mux_InitConfigArr_PortContainer_0_BOARD_InitPeripherals ); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;volatile Adc_Sar_Ip_StatusType status = ADC_SAR_IP_STATUS_ERROR; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;status = Adc_Sar_Ip_Init(0, &amp;amp;AdcHwUnit_0); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;status = Adc_Sar_Ip_DoCalibration(0); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Adc_Sar_Ip_EnableNotifications( 0, ADC_SAR_IP_NOTIF_FLAG_NORMAL_ENDCHAIN );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Siul2_Dio_Ip_TogglePins(PTA_L_HALF, 1U &amp;lt;&amp;lt; 1U); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Adc_Sar_Ip_StartConversion( 0,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ADC_SAR_IP_CONV_CHAIN_NORMAL ); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;while (1) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ __asm__("nop"); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;void Adc_EndOfNormalChain_Callback(void) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Siul2_Dio_Ip_TogglePins(PTA_L_HALF, 1U &amp;lt;&amp;lt; 1U);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I measure the time between the two GPIO transitions using a logic analyzer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Based on the ADC timing alone, I calculated it,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;which gives approximately 700ns.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, the measured GPIO pulse width is approximately 4us.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to understand the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;What is the correct formula for a single normal conversion when pre-sampling and hardware averaging are disabled?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Does the ADC calibration performed by &lt;/SPAN&gt;&lt;SPAN&gt;Adc_Sar_Ip_DoCalibration()&lt;/SPAN&gt;&lt;SPAN&gt; affect the timing of every subsequent ADC conversion, or does it only calculate/store calibration values during initialization?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Do gain correction, offset correction, internal capacitor charging, settling time, or any internal ADC processing add additional cycles to every conversion?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;What is the exact conversion-time formula for the S32K312 SAR ADC for one channel in normal conversion mode?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Does the measured time between:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Adc_Sar_Ip_StartConversion()&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;and &lt;/SPAN&gt;&lt;SPAN&gt;Adc_EndOfNormalChain_Callback()&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;include significant RTD software overhead, interrupt latency, ISR processing, or callback overhead?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Is there a recommended method to measure only the ADC hardware conversion time, excluding RTD and interrupt overhead?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;If possible, could you provide the expected ADC timing in clock cycles for this configuration?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;My main objective is to determine whether the approximately 4 µs measurement is caused mainly by ADC hardware timing or by RTD/interrupt/software overhead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help related to this ADC conversion is appreciated!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2026 19:13:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ADC-Conversion-time-issue/m-p/2418319#M61305</guid>
      <dc:creator>durga-kolluru</dc:creator>
      <dc:date>2026-10-04T19:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Conversion time issue</title>
      <link>https://community.nxp.com/t5/S32K/ADC-Conversion-time-issue/m-p/2418361#M61309</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;DIV&gt;
&lt;P&gt;The ADC conversion-time equation is provided directly in S32K3 Reference Manual, section 60.3.18 "Conversion time". For your configuration (single channel, pre-sampling disabled, hardware averaging disabled), the conversion time can be calculated using that formula and the configured ADC clock.&lt;/P&gt;
&lt;P&gt;A few additional notes:&lt;/P&gt;
&lt;P&gt;1. Adc_Sar_Ip_DoCalibration() does not affect the timing of subsequent conversions. Calibration is executed during initialization and the calibration values are then used by the ADC hardware.&lt;/P&gt;
&lt;P&gt;2. The measured ~4 µs is not ADC conversion time only. Your measurement spans:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Adc_Sar_Ip_StartConversion()&lt;/LI&gt;
&lt;LI&gt;ADC sampling and conversion&lt;/LI&gt;
&lt;LI&gt;ADC interrupt generation&lt;/LI&gt;
&lt;LI&gt;NVIC interrupt latency&lt;/LI&gt;
&lt;LI&gt;RTD ISR processing&lt;/LI&gt;
&lt;LI&gt;Callback dispatch&lt;/LI&gt;
&lt;LI&gt;GPIO toggle operations&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Therefore, the measured pulse width includes both ADC hardware time and software overhead. It is expected to be noticeably larger than the conversion time calculated from the RM formula alone.&lt;/P&gt;
&lt;P&gt;3. To measure the ADC hardware conversion time more accurately, we can recommend below&lt;/P&gt;
&lt;DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Toggle the first GPIO immediately after Adc_Sar_Ip_StartConversion() returns. This removes most of the start-API execution time from the measured pulse.&lt;/LI&gt;
&lt;LI&gt;In the ADC interrupt handler, toggle GPIO as early as possible, before calling the configured notification callback. This separates interrupt entry from callback-dispatch overhead.&lt;/LI&gt;
&lt;LI&gt;For the lowest GPIO software overhead, temporarily use a direct SIUL2 GPIO register write instead of Siul2_Dio_Ip_TogglePins().&lt;/LI&gt;
&lt;LI&gt;Alternatively, poll the ADC end-of-chain status flag and toggle the GPIO immediately when the hardware flag becomes set. This excludes NVIC and callback overhead, although polling-loop and GPIO-write latency remain.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;So, based on the information provided, the ~4 µs measurement is most likely dominated by the complete software/interrupt path rather than the ADC conversion itself.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 05 Oct 2026 07:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ADC-Conversion-time-issue/m-p/2418361#M61309</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2026-10-05T07:54:50Z</dc:date>
    </item>
  </channel>
</rss>

