<?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>S32KのトピックRe: Input PWM is zero for SDK</title>
    <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1245981#M10180</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Our input signal (Type)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;T = 120ms.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hz = 0.0083333333333KHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="tgt"&gt;How do we use the data we have to calculate the duty cycle?&lt;/SPAN&gt;&lt;SPAN class="tgt"&gt;Could you give me an example? Thank you&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Mar 2021 02:28:55 GMT</pubDate>
    <dc:creator>linglei_meng</dc:creator>
    <dc:date>2021-03-16T02:28:55Z</dc:date>
    <item>
      <title>Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1234145#M9954</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello Community&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We want to detect the Crash signal input and configure it according to the example, but there is no return value of IC_GETMEASUREMENT (), please help us to check whether we made a mistake in the configuration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip version：S32K148 -&amp;gt; 144&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PIN: PTD18 &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hardware environment: SRS analog input&lt;BR /&gt;Config: FTM5_CH7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for example: ic_pal_s32k148&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MCU detects CRASH signal input,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;uint16_t inputCaptureMeas = 0U;&lt;BR /&gt;uint16_t inputMeas = 0U;&lt;BR /&gt;uint32_t frequency;&lt;BR /&gt;uint8_t channel = ic_pal1_ChnConfig-&amp;gt;hwChannelId;&lt;/P&gt;&lt;P&gt;IC_Init(&amp;amp;ic_pal1_instance, &amp;amp;ic_pal1_InitConfig);&lt;BR /&gt;&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; frequency = FTM_DRV_GetFrequency(ic_pal1_instance.instIdx);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; inputCaptureMeas = IC_GetMeasurement(&amp;amp;ic_pal1_instance, channel);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; inputMeas = frequency / (inputCaptureMeas);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; JPCC_DEBUG(JPCC_LOG_LEVEL_WARNING, "[ SensorApp] 6 PWM uFrequencyHZ=[%lu],&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;frequency=[%lu], inputCaptureMeas=[%u], inputMeas=[%lu]\r\n",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; flexTimer_pwm1_PwmConfig.uFrequencyHZ, frequency, inputCaptureMeas, inputMeas);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; OS_sleep(300);&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 06:40:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1234145#M9954</guid>
      <dc:creator>linglei_meng</dc:creator>
      <dc:date>2021-02-22T06:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1234226#M9958</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Analog CRASH signal&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 08:29:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1234226#M9958</guid>
      <dc:creator>linglei_meng</dc:creator>
      <dc:date>2021-02-22T08:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1234904#M9972</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you please attach the project?&lt;/P&gt;
&lt;P&gt;The issue could be in the PIN driver, for example.&lt;/P&gt;
&lt;P&gt;Can you scope the signal on PTD18?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 10:08:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1234904#M9972</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2021-02-23T10:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1244791#M10146</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Configuration changes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PIN: PTC10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hardware environment: SRS analog input&lt;BR /&gt;Config: FTM3_CH4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The current configuration has SRS input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We would like to know how to calculate the duty cycle. Could you provide a specific calculation formula?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;6148 = IC_GetMeasurement(&amp;amp;ic_pal1_instance, channel);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;duty = 40%.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 11:15:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1244791#M10146</guid>
      <dc:creator>linglei_meng</dc:creator>
      <dc:date>2021-03-12T11:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1245555#M10163</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The IC_GetMeasurement() function returns the duty-cycle value in FTM3 ticks (24MHz).&lt;/P&gt;
&lt;P&gt;If you know the period of the input signal, you can easily calculate the duty-cycle in %.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 08:56:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1245555#M10163</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2021-03-15T08:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1245955#M10179</link>
      <description>&lt;DIV class="lia-message-author-with-avatar"&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-NXP-TechSupport lia-component-message-view-widget-author-username"&gt;&lt;SPAN&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/160001"&gt;@danielmartynek&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-with-avatar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-message-author-with-avatar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-message-author-with-avatar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-message-author-with-avatar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-message-author-with-avatar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-message-author-with-avatar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;The signal input frequency we use is as shown in "crah.jpg"，I don't know how to calculate the duty cycle according to them. Could you please give me a calculation method or formula?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 01:42:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1245955#M10179</guid>
      <dc:creator>linglei_meng</dc:creator>
      <dc:date>2021-03-16T01:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1245981#M10180</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Our input signal (Type)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;T = 120ms.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hz = 0.0083333333333KHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="tgt"&gt;How do we use the data we have to calculate the duty cycle?&lt;/SPAN&gt;&lt;SPAN class="tgt"&gt;Could you give me an example? Thank you&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 02:28:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1245981#M10180</guid>
      <dc:creator>linglei_meng</dc:creator>
      <dc:date>2021-03-16T02:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1247259#M10214</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The IC_GetMeasurement() function returns number of FTM ticks measured while the input signal is ON.&lt;/P&gt;
&lt;P&gt;One FTM tick is one period of the FTM function clock.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of the PAL driver, you can use the FTM_IC driver.&lt;/P&gt;
&lt;P&gt;Example: ftm_signal_measurement_s32k148&lt;/P&gt;
&lt;P&gt;With this configuration:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1615984207385.png" style="width: 545px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/139920i70A366D457A5DF36/image-dimensions/545x312?v=v2" width="545" height="312" role="button" title="danielmartynek_0-1615984207385.png" alt="danielmartynek_0-1615984207385.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The driver can measure input signal:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_2-1615984291953.png" style="width: 666px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/139922i77EEE3B43CD21C4A/image-dimensions/666x228?v=v2" width="666" height="228" role="button" title="danielmartynek_2-1615984291953.png" alt="danielmartynek_2-1615984291953.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you need to measure signal of frequency 8.33Hz, you need to select a slower FTM clock.&lt;/P&gt;
&lt;P&gt;For example,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_3-1615984490380.png" style="width: 642px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/139923iCE7711983FC7D653/image-dimensions/642x363?v=v2" width="642" height="363" role="button" title="danielmartynek_3-1615984490380.png" alt="danielmartynek_3-1615984490380.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="danielmartynek_4-1615984521734.png" style="width: 727px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/139924i9905816D18BF6BC9/image-dimensions/727x218?v=v2" width="727" height="218" role="button" title="danielmartynek_4-1615984521734.png" alt="danielmartynek_4-1615984521734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this case, 1 FTM clock cycle = 1 FTM tick = 1/62500 = 16us is resolution of the measurement.&lt;/P&gt;
&lt;P&gt;You could use faster FTM clock frequency but you would need to count the FTM overflows and add it to the time captured between the two edges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 12:55:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1247259#M10214</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2021-03-17T12:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1253507#M10346</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Our input signal (Type)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;T = 120ms.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hz = 0.0083333333333KHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Duty = 90%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FTM_DRV_GetInputCaptureMeasurement(INST_FLEXTIMER_IC1, 4U)&amp;nbsp; = 28;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 FTM clock cycle = 1 FTM tick = 1/62500 = 16us is resolution of the measurement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Duty cycle calculation formula:&amp;nbsp; (28 * 16us) / 120ms = 90%&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is that the calculation?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you specify the duty cycle calculation formula with the above parameters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="linglei_meng_4-1617011154697.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/140866i0849D74AC7FEF7C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linglei_meng_4-1617011154697.png" alt="linglei_meng_4-1617011154697.png" /&gt;&lt;/span&gt;&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="linglei_meng_1-1617010768244.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/140862i44B730FDFF0F50BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linglei_meng_1-1617010768244.png" alt="linglei_meng_1-1617010768244.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="linglei_meng_2-1617010944153.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/140864iCBF6F778B07C8683/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linglei_meng_2-1617010944153.png" alt="linglei_meng_2-1617010944153.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="linglei_meng_3-1617011010840.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/140865iEF728BF158418540/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linglei_meng_3-1617011010840.png" alt="linglei_meng_3-1617011010840.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 09:49:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1253507#M10346</guid>
      <dc:creator>linglei_meng</dc:creator>
      <dc:date>2021-03-29T09:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Input PWM is zero for SDK</title>
      <link>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1253513#M10347</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Looking at the screenshots you posted, I see the FTM frequency is set to 256Hz.&lt;/P&gt;
&lt;P&gt;The resolution is therefore 1/256 = 3.9ms&lt;/P&gt;
&lt;P&gt;3.9ms * 28 = 109.2ms which is 91% of 120ms.&lt;/P&gt;
&lt;P&gt;If you need to have a higher resolution, you need to set a higher FTM frequency.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 10:03:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Input-PWM-is-zero-for-SDK/m-p/1253513#M10347</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2021-03-29T10:03:32Z</dc:date>
    </item>
  </channel>
</rss>

