<?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: BCTU ADC FIFO conversion time in S32K</title>
    <link>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/2000121#M43553</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;not sure of the RTD you have but e.g. in RTD400 I see correct assignment for HSEN and CMPCTRL0, following the RM&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PetrS_0-1732281249104.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/312027i990FBD67B4CF50B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PetrS_0-1732281249104.png" alt="PetrS_0-1732281249104.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Nov 2024 13:14:41 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2024-11-22T13:14:41Z</dc:date>
    <item>
      <title>BCTU ADC FIFO conversion time</title>
      <link>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/1981443#M42501</link>
      <description>&lt;P&gt;I have some adc conversions that are being triggered from a bctu hw trigger.&amp;nbsp;&lt;BR /&gt;i have emios 1 ch0 set up as my timebase with 5000 ticks and a system clock of 160mhz so my timer period is 31.25 us (32khz).&lt;BR /&gt;I have my bctu fifo set up to sample all three adcs for three channels.&lt;BR /&gt;so my conversion time should be 2.8 us.&lt;BR /&gt;&lt;BR /&gt;i added an breakpoint in&amp;nbsp;&lt;SPAN&gt;Bctu_Ip_Bctu0Fifo1DmaComplete&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;void&lt;/SPAN&gt;&lt;SPAN&gt;) to see the value of emios 1 ch0 CNT to get an understanding of when the adc values are being processed.&lt;BR /&gt;&lt;BR /&gt;emios 1 ch4 is being used as the trigger for the adc conversion. which i have set to trigger at 4500 ticks.&amp;nbsp;&lt;BR /&gt;now what i'm seeing is that the value of emios1ch0 CNT is always around 460. which means it's taking 960 ticks from the adc trigger to the dma complete trigger.&lt;BR /&gt;what i don't understand is where the additional ~500ticks are coming from.&lt;BR /&gt;i also moved the adc conversion trigger from 4500 to 4998 and then the value of cnt was 960 so the duration seems to be consistent, but i am wondering how much delay there is between the start of first adc sample and the adc conversion trigger?&amp;nbsp;&lt;BR /&gt;i also understand that there would be some delay between conversion completion and bctuFIFOdma interrupt being triggered but how much that delay should be I can't clearly reason out for myself.&lt;BR /&gt;&lt;BR /&gt;my dma interrupt is already the highest priority interrupt in the system so i doubt there is delay there but are there any settings i can or should configure to ensure this timeline is as tight as possible.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Conversion time math:&lt;BR /&gt;Total_conversion_time = ( [(PST + ST + CT + DP) × chain_length] + TPT) × TAD_clk&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;The ADC controller clock is equal to the module clock (80 MHz, clock cyle = 12.5 ns)&lt;BR /&gt;• ADC resolution 12 bit + 1 bit for a special capacitor (CS)&lt;BR /&gt;• Three channels are programmed in NCMRn , so a chain of three is to be converted&lt;BR /&gt;• Default sample time (22 cycles) is specified&lt;BR /&gt;• No presampling&lt;BR /&gt;• Conversion time (4 cycles per bit)&lt;BR /&gt;The total time for the three conversions = [(0 + 22 + (4×13) + 2) × 3] + 1 = 229 cycles ~= 2.862 µs&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 18:05:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/1981443#M42501</guid>
      <dc:creator>not_a_duck</dc:creator>
      <dc:date>2024-10-24T18:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: BCTU ADC FIFO conversion time</title>
      <link>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/1984577#M42707</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;hard to say without knowledge of actual setting you have. Can you share your project?&lt;BR /&gt;Calculation looks correct, but do you really have AD_clock 80Mhz?&lt;BR /&gt;There should be minimum SW overhead when DMA is reading FIFO.&lt;/P&gt;
&lt;P&gt;BR, Petr&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 08:44:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/1984577#M42707</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-10-30T08:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: BCTU ADC FIFO conversion time</title>
      <link>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/1991216#M43072</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I think there may be a bug in the ADC HW access for setting HSEN and CMPCTRL0.&lt;BR /&gt;&lt;BR /&gt;I just collected some data on this.&lt;BR /&gt;So i checked the ADC&amp;lt;0,1,2&amp;gt;_CLK before the system_clock config runs, after the adc_init is called and after calibration.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;adc0_clk[0] = Clock_Ip_GetClockFrequency(ADC0_CLK);
adc1_clk[0] = Clock_Ip_GetClockFrequency(ADC1_CLK);
adc2_clk[0] = Clock_Ip_GetClockFrequency(ADC2_CLK);

Clock_Ip_StatusType eClockStatus = Clock_Ip_Init(&amp;amp;Clock_Ip_aClockConfig[0]);
bool bClockInitSuccess = ( eClockStatus == CLOCK_IP_SUCCESS );

Adc_Sar_Ip_StatusType adc0_status = Adc_Sar_Ip_Init(ADCHWUNIT_0_INSTANCE, &amp;amp;AdcHwUnit_0);
Adc_Sar_Ip_StatusType adc1_status = Adc_Sar_Ip_Init(ADCHWUNIT_1_INSTANCE, &amp;amp;AdcHwUnit_1);
Adc_Sar_Ip_StatusType adc2_status = Adc_Sar_Ip_Init(ADCHWUNIT_2_INSTANCE, &amp;amp;AdcHwUnit_2);
PANIC_ASSERT( adc0_status == ADC_SAR_IP_STATUS_SUCCESS );
PANIC_ASSERT( adc1_status == ADC_SAR_IP_STATUS_SUCCESS );
PANIC_ASSERT( adc2_status == ADC_SAR_IP_STATUS_SUCCESS );

// ...

adc0_clk[1] = Clock_Ip_GetClockFrequency(ADC0_CLK);
adc1_clk[1] = Clock_Ip_GetClockFrequency(ADC1_CLK);
adc2_clk[1] = Clock_Ip_GetClockFrequency(ADC2_CLK);

/* Call Calibration function multiple times, to mitigate instability of board source */
for (int i = 0; i &amp;lt;= kBSP_ADC_CalibrationAttemptCount; i++)
{
    if ( Adc_Sar_Ip_DoCalibration(ADCHWUNIT_0_INSTANCE) == E_OK)
    {
        break;
    }
}

/* Call Calibration function multiple times, to mitigate instability of board source */
for (int i = 0; i &amp;lt;= kBSP_ADC_CalibrationAttemptCount; i++)
{
    if ( Adc_Sar_Ip_DoCalibration(ADCHWUNIT_1_INSTANCE) == E_OK)
    {
        break;
    }
}

/* Call Calibration function multiple times, to mitigate instability of board source */
for (int i = 0; i &amp;lt;= kBSP_ADC_CalibrationAttemptCount; i++)
{
    if ( Adc_Sar_Ip_DoCalibration(ADCHWUNIT_2_INSTANCE) == E_OK)
    {
        break;
    }
}

adc0_clk[2] = Clock_Ip_GetClockFrequency(ADC0_CLK);
adc1_clk[2] = Clock_Ip_GetClockFrequency(ADC1_CLK);
adc2_clk[2] = Clock_Ip_GetClockFrequency(ADC2_CLK);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i'm seeing 160,000,000 for all of them.&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-08 at 9.08.15 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/309462i3FB6B2B24FC81A7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-08 at 9.08.15 AM.png" alt="Screenshot 2024-11-08 at 9.08.15 AM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-08 at 9.07.16 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/309465iDDE016433A3DAC42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-08 at 9.07.16 AM.png" alt="Screenshot 2024-11-08 at 9.07.16 AM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;next i checked MCR and AMSIO to check that they match what is described in table 317 in the reference manual.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-08 at 9.09.25 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/309463i65C3B0BD9BF058B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-08 at 9.09.25 AM.png" alt="Screenshot 2024-11-08 at 9.09.25 AM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-08 at 9.09.47 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/309464i1FB0BA18CD2C0EEC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-08 at 9.09.47 AM.png" alt="Screenshot 2024-11-08 at 9.09.47 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MCR[ADCLKSEL] is set to 1 which seems correct. meaning that the ADC_CLK is 80mhz.&lt;BR /&gt;&lt;BR /&gt;AMSIO[HSEN] is set to 2. that doesn’t seem right. it should be set to 0.&lt;BR /&gt;AMSIO[CMPCTRL0] is set to 0.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is this a bug in the ADC_HW access function then?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Adc_Sar_Ip_StatusType Adc_Sar_Ip_SetClockMode(const uint32 u32Instance,
                                              const Adc_Sar_Ip_ClockConfigType * const pConfig)
// ...
#if FEATURE_ADC_HAS_HIGH_SPEED_ENABLE
            SchM_Enter_Adc_ADC_EXCLUSIVE_AREA_51();
            /* Enables high speed conversion or calibration */
            Adc_Sar_EnableHighSpeed(AdcBasePtr, pConfig-&amp;gt;HighSpeedConvEn);
            SchM_Exit_Adc_ADC_EXCLUSIVE_AREA_51();
#endif /* FEATURE_ADC_HAS_HIGH_SPEED_ENABLE */
// ...
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#if FEATURE_ADC_HAS_HIGH_SPEED_ENABLE
/*FUNCTION*********************************************************************
 *
 * Function Name : Adc_Sar_EnableHighSpeed
 * Description   : Enable a high-speed calibration or a high-speed conversion
 *
 *END*************************************************************************/
static inline void Adc_Sar_EnableHighSpeed(ADC_Type * const Base,
                                           boolean Enable)
{
    uint32 Amsio = Base-&amp;gt;AMSIO;
    Amsio &amp;amp;= ~(ADC_AMSIO_HSEN_MASK);
    Amsio |= ADC_AMSIO_HSEN(Enable ? 3u : 0u);
    Base-&amp;gt;AMSIO = Amsio;
}
#endif /* FEATURE_ADC_HAS_HIGH_SPEED_ENABLE */&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;If EnableHighSpeed is set to true. this function writes 3 to HSEN. but setting HSEN to 3 does not seem to be a valid option as describe in the table. it should instead be writing 1 to HSEN and 1 to CMPCTRL0. but that is not what this function is doing.&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;but regardless of this bug it seems that i should have high speed enable set to false in my configuration.&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 17:52:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/1991216#M43072</guid>
      <dc:creator>not_a_duck</dc:creator>
      <dc:date>2024-11-08T17:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: BCTU ADC FIFO conversion time</title>
      <link>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/2000121#M43553</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;not sure of the RTD you have but e.g. in RTD400 I see correct assignment for HSEN and CMPCTRL0, following the RM&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PetrS_0-1732281249104.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/312027i990FBD67B4CF50B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PetrS_0-1732281249104.png" alt="PetrS_0-1732281249104.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 13:14:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/BCTU-ADC-FIFO-conversion-time/m-p/2000121#M43553</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-11-22T13:14:41Z</dc:date>
    </item>
  </channel>
</rss>

