<?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 S32K312 PWM Measurement in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1957749#M41145</link>
    <description>&lt;DIV&gt;&lt;P&gt;Hello, I have some questions regarding using the S32K312 EMIOS ICU for PWM measurement, and I would like to consult with you.&lt;/P&gt;&lt;P&gt;I am encountering an issue where the measured PWM period and duty cycle are both zero, but when I check the input pin with an oscilloscope, I can see a PWM wave being input.&lt;/P&gt;&lt;P&gt;Here is my code and configuration:&lt;/P&gt;&lt;P&gt;#define EMIOS_PWMIN_CHANNEL_1 2U /* EMIOS0 Channel 2 */&lt;BR /&gt;#define EMIOS_PWMIN_CHANNEL_2 3U /* EMIOS0 Channel 3 */&lt;BR /&gt;&lt;BR /&gt;// Step 1: ICU Initialization&lt;BR /&gt;Emios_Mcl_Ip_Init(EMIOS_INSTANCE_0, &amp;amp;Emios_Mcl_Ip_0_Config_BOARD_INITPERIPHERALS);&lt;BR /&gt;Emios_Mcl_Ip_Init(EMIOS_INSTANCE_1, &amp;amp;Emios_Mcl_Ip_1_Config_BOARD_INITPERIPHERALS);&lt;BR /&gt;Emios_Icu_Ip_Init(0, &amp;amp;eMios_Icu_Ip_0_Config_PB);&lt;BR /&gt;IntCtrl_Ip_EnableIrq(EMIOS0_5_IRQn);&lt;BR /&gt;IntCtrl_Ip_InstallHandler(EMIOS0_5_IRQn, &amp;amp;EMIOS0_5_IRQ, NULL_PTR);&lt;BR /&gt;Emios_Icu_Ip_StartSignalMeasurement(0, EMIOS_PWMIN_CHANNEL_1);&lt;BR /&gt;Emios_Icu_Ip_StartSignalMeasurement(0, EMIOS_PWMIN_CHANNEL_2);&lt;BR /&gt;&lt;BR /&gt;// Step 2: Running the following code at a 10ms interval&lt;BR /&gt;PWM_IN_1.period = 1000 * (float32)eMios_Icu_Ip_ChState[0].eMios_Icu_Ip_aPeriod /&lt;BR /&gt;(float32)Clock_Ip_GetClockFrequency(EMIOS0_CLK);&lt;BR /&gt;PWM_IN_1.duty = (float32)eMios_Icu_Ip_ChState[0].eMios_Icu_Ip_aActivePulseWidth /&lt;BR /&gt;(float32)(eMios_Icu_Ip_ChState[0].eMios_Icu_Ip_aPeriod + 1);&lt;BR /&gt;&lt;BR /&gt;PWM_IN_2.period = 1000 * (float32)eMios_Icu_Ip_ChState[1].eMios_Icu_Ip_aPeriod /&lt;BR /&gt;(float32)Clock_Ip_GetClockFrequency(EMIOS0_CLK);&lt;BR /&gt;PWM_IN_2.duty = (float32)eMios_Icu_Ip_ChState[1].eMios_Icu_Ip_aActivePulseWidth /&lt;BR /&gt;(float32)(eMios_Icu_Ip_ChState[1].eMios_Icu_Ip_aPeriod + 1);&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300041i896E0B1EBBC8130D/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-1.png" alt="1-1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-2.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300042i3ACFA93EC2D78343/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-2.png" alt="1-2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-3.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300043iE7449A6E885582F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-3.png" alt="1-3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-4.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300045iA023B25C14AFF6FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-4.png" alt="1-4.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-5.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300044i12CB05333503CEAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-5.png" alt="1-5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-6.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300046i42D37B39C862F3A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-6.png" alt="1-6.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-7.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300047i73FE43AE0BCFDCB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-7.png" alt="1-7.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-8.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300048iFC8C20FEAE8E609B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-8.png" alt="1-8.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 19 Sep 2024 13:33:14 GMT</pubDate>
    <dc:creator>fengba_360</dc:creator>
    <dc:date>2024-09-19T13:33:14Z</dc:date>
    <item>
      <title>S32K312 PWM Measurement</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1957749#M41145</link>
      <description>&lt;DIV&gt;&lt;P&gt;Hello, I have some questions regarding using the S32K312 EMIOS ICU for PWM measurement, and I would like to consult with you.&lt;/P&gt;&lt;P&gt;I am encountering an issue where the measured PWM period and duty cycle are both zero, but when I check the input pin with an oscilloscope, I can see a PWM wave being input.&lt;/P&gt;&lt;P&gt;Here is my code and configuration:&lt;/P&gt;&lt;P&gt;#define EMIOS_PWMIN_CHANNEL_1 2U /* EMIOS0 Channel 2 */&lt;BR /&gt;#define EMIOS_PWMIN_CHANNEL_2 3U /* EMIOS0 Channel 3 */&lt;BR /&gt;&lt;BR /&gt;// Step 1: ICU Initialization&lt;BR /&gt;Emios_Mcl_Ip_Init(EMIOS_INSTANCE_0, &amp;amp;Emios_Mcl_Ip_0_Config_BOARD_INITPERIPHERALS);&lt;BR /&gt;Emios_Mcl_Ip_Init(EMIOS_INSTANCE_1, &amp;amp;Emios_Mcl_Ip_1_Config_BOARD_INITPERIPHERALS);&lt;BR /&gt;Emios_Icu_Ip_Init(0, &amp;amp;eMios_Icu_Ip_0_Config_PB);&lt;BR /&gt;IntCtrl_Ip_EnableIrq(EMIOS0_5_IRQn);&lt;BR /&gt;IntCtrl_Ip_InstallHandler(EMIOS0_5_IRQn, &amp;amp;EMIOS0_5_IRQ, NULL_PTR);&lt;BR /&gt;Emios_Icu_Ip_StartSignalMeasurement(0, EMIOS_PWMIN_CHANNEL_1);&lt;BR /&gt;Emios_Icu_Ip_StartSignalMeasurement(0, EMIOS_PWMIN_CHANNEL_2);&lt;BR /&gt;&lt;BR /&gt;// Step 2: Running the following code at a 10ms interval&lt;BR /&gt;PWM_IN_1.period = 1000 * (float32)eMios_Icu_Ip_ChState[0].eMios_Icu_Ip_aPeriod /&lt;BR /&gt;(float32)Clock_Ip_GetClockFrequency(EMIOS0_CLK);&lt;BR /&gt;PWM_IN_1.duty = (float32)eMios_Icu_Ip_ChState[0].eMios_Icu_Ip_aActivePulseWidth /&lt;BR /&gt;(float32)(eMios_Icu_Ip_ChState[0].eMios_Icu_Ip_aPeriod + 1);&lt;BR /&gt;&lt;BR /&gt;PWM_IN_2.period = 1000 * (float32)eMios_Icu_Ip_ChState[1].eMios_Icu_Ip_aPeriod /&lt;BR /&gt;(float32)Clock_Ip_GetClockFrequency(EMIOS0_CLK);&lt;BR /&gt;PWM_IN_2.duty = (float32)eMios_Icu_Ip_ChState[1].eMios_Icu_Ip_aActivePulseWidth /&lt;BR /&gt;(float32)(eMios_Icu_Ip_ChState[1].eMios_Icu_Ip_aPeriod + 1);&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300041i896E0B1EBBC8130D/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-1.png" alt="1-1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-2.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300042i3ACFA93EC2D78343/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-2.png" alt="1-2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-3.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300043iE7449A6E885582F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-3.png" alt="1-3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-4.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300045iA023B25C14AFF6FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-4.png" alt="1-4.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-5.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300044i12CB05333503CEAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-5.png" alt="1-5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-6.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300046i42D37B39C862F3A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-6.png" alt="1-6.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-7.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300047i73FE43AE0BCFDCB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-7.png" alt="1-7.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1-8.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300048iFC8C20FEAE8E609B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1-8.png" alt="1-8.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Sep 2024 13:33:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1957749#M41145</guid>
      <dc:creator>fengba_360</dc:creator>
      <dc:date>2024-09-19T13:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 PWM Measurement</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1960128#M41261</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/238047"&gt;@fengba_360&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find my answer in the form of software. This project configures EMIOS 0 CH0 as PWM and EMIOS 0 CH2 as SAIC for duty cycle measurement.&lt;/P&gt;
&lt;P&gt;NOTE: The example code was developed using RTD version 4.0.0 P14 and the S32K3x4-T172EVB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, VaneB&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 20:51:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1960128#M41261</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2024-09-23T20:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 PWM Measurement</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1960348#M41270</link>
      <description>&lt;P&gt;Thank you for your help. Currently, I am able to collect data, but I found that the duty cycle and period do not match my expectations. I input a PWM wave with 1KHZ and a duty cycle of 50% using the signal generator.&lt;/P&gt;&lt;P&gt;However, the collected data shows that ic_result_temp.PeriodTime = 54472, and ic_result_temp.ActiveTime = 1775.&lt;/P&gt;&lt;P&gt;According to the formula, the calculated duty cycle is 100*1775/54472=3%. And the frequency is Clock_Ip_GetClockFrequency(EMIOS0_CLK)/54472= 120MHZ/54472=2202HZ. Could you please take a look at it again?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="微信图片_20240924120202.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300814i1027A431EC920535/image-size/large?v=v2&amp;amp;px=999" role="button" title="微信图片_20240924120202.png" alt="微信图片_20240924120202.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="微信图片_20240924120056.jpg" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/300813iBC712E517694DA43/image-size/large?v=v2&amp;amp;px=999" role="button" title="微信图片_20240924120056.jpg" alt="微信图片_20240924120056.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 04:05:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1960348#M41270</guid>
      <dc:creator>fengba_360</dc:creator>
      <dc:date>2024-09-24T04:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 PWM Measurement</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1962017#M41347</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/238047"&gt;@fengba_360&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To the example code previous provided I have changed the configuration to measure a PWM of 1KHz with a duty cycle of 50% and resulting in a duty cycle of 49%.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 19:46:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-PWM-Measurement/m-p/1962017#M41347</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2024-09-25T19:46:30Z</dc:date>
    </item>
  </channel>
</rss>

