<?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 gpio sampling rate in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/gpio-sampling-rate/m-p/1540998#M7753</link>
    <description>&lt;P&gt;Hello i am trying to interface a noctua pwm fan with the s32k144evb . the fan provides rpm feedback as pwm output. i made a rpm counter model to measure the frequency of the pwm output provided by the fan to get the rpm value. The gpio pins are not able to sample the signal at frequency above 50hz. i tried generating a square pulse and gave it as a input to gpio pin and measured the signal using a oscilloscope by giving the gpio output to another gpio block. gpio tracks the pulse till 50hz after that it just shows a straight line at 5v&lt;/P&gt;&lt;P&gt;i want to know what is the sampling rate of the gpio pins and the adc in s32k166 and s32k144&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 08:37:01 GMT</pubDate>
    <dc:creator>Sriram</dc:creator>
    <dc:date>2022-10-20T08:37:01Z</dc:date>
    <item>
      <title>gpio sampling rate</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/gpio-sampling-rate/m-p/1540998#M7753</link>
      <description>&lt;P&gt;Hello i am trying to interface a noctua pwm fan with the s32k144evb . the fan provides rpm feedback as pwm output. i made a rpm counter model to measure the frequency of the pwm output provided by the fan to get the rpm value. The gpio pins are not able to sample the signal at frequency above 50hz. i tried generating a square pulse and gave it as a input to gpio pin and measured the signal using a oscilloscope by giving the gpio output to another gpio block. gpio tracks the pulse till 50hz after that it just shows a straight line at 5v&lt;/P&gt;&lt;P&gt;i want to know what is the sampling rate of the gpio pins and the adc in s32k166 and s32k144&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 08:37:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/gpio-sampling-rate/m-p/1540998#M7753</guid>
      <dc:creator>Sriram</dc:creator>
      <dc:date>2022-10-20T08:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: gpio sampling rate</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/gpio-sampling-rate/m-p/1541987#M7754</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;If you want to get better results, I suggest you to check the example "ftm_input_capture_s32k14x" included in the toolbox. It uses the FTM peripheral to get the timestamp of the channel input event. The timestamp is computed based on the System Clock (80 MHz).&lt;/P&gt;
&lt;P&gt;Example: If the timestamp is 2000 (with the Prescale Factor of 2) it means that the frequency of the PWM signal is&amp;nbsp;&lt;STRONG&gt; System_Clock /&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;STRONG&gt;Timestamp * Prescale_Factor) =&amp;nbsp;&lt;/STRONG&gt;80 MHz / (2000 * 2) = 80000 kHz / 4000 = 20 kHz.&lt;/P&gt;
&lt;P&gt;Let me know if this solution works for you.&lt;/P&gt;
&lt;P&gt;Yours faithfully,&lt;/P&gt;
&lt;P&gt;Bancila Sorin&lt;/P&gt;
&lt;P&gt;PS: Whenever you need to have fast execution time, the Freemaster can add a lot of overhead. In order to solve this problem, you can go to Freemaster and select the&amp;nbsp;&lt;STRONG&gt;Sampling&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;period&lt;/STRONG&gt; of the variable you want to monitor to&amp;nbsp;&lt;STRONG&gt;Once&lt;/STRONG&gt;. In the model, you need to add the &lt;STRONG&gt;Freemaster_Poll_Call &lt;/STRONG&gt;block&amp;nbsp;to update the variable. You can add this block in a &lt;STRONG&gt;Triggered Subsystem &lt;/STRONG&gt;and then use&amp;nbsp;timers (e.g &lt;STRONG&gt;PIT)&lt;/STRONG&gt; to&amp;nbsp;execute at a slower pace&amp;nbsp;(e.g. 1 sec).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 13:09:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/gpio-sampling-rate/m-p/1541987#M7754</guid>
      <dc:creator>SorinIBancila</dc:creator>
      <dc:date>2022-10-21T13:09:15Z</dc:date>
    </item>
  </channel>
</rss>

