<?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>Kinetis MicrocontrollersのトピックRe: eFlexPWM input capture</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/eFlexPWM-input-capture/m-p/1304722#M61007</link>
    <description>&lt;P&gt;Hello Omar,&lt;/P&gt;&lt;P&gt;thank you for your response!&lt;/P&gt;&lt;P&gt;I already studied your mentioned document during my initial setup of the PWM input capture.&lt;/P&gt;&lt;P&gt;In general I think the problem is based on the selection of my µC-Pin setup.&lt;BR /&gt;You can see that I am using the crossbar switch for my input signal in order to connect&amp;nbsp; my µC-Pin with the multiplex XB_In3 to "kXBARA_OutputPwmCh0ExtA".&lt;BR /&gt;After rereading the reference manual, I think the setup failed because I tried using a extern synchronisation input instead of using a correct µC-Pin with e.g. "FLEXPWM0_A0" multiplex.&lt;BR /&gt;&lt;BR /&gt;As I am currently not able to reroute the tacho-signal on my pcb to an other µC pin, I will get back to this case when I have the opportunity to make those changes.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;BR /&gt;Julian&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2021 13:14:03 GMT</pubDate>
    <dc:creator>SMNJS</dc:creator>
    <dc:date>2021-07-08T13:14:03Z</dc:date>
    <item>
      <title>eFlexPWM input capture</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/eFlexPWM-input-capture/m-p/1299746#M60936</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am testing the pwm input capture capabilities on the MKV58F1M0VLQ24 and I guess that I miss something basic here.&lt;/P&gt;&lt;P&gt;In general, I am aware that for input capturing, the FTM Module is the first choice. I already validated this module successfully capturing the tacho signal of a fan (signal frequency at ~300 Hz). In order to validate the pwm input capture capabilities (for general module testing purposes) I am now trying to get a similar result for the same hardware setup.&lt;/P&gt;&lt;P&gt;To my setup:&lt;BR /&gt;The tacho is connected to the µC pin PORTE25 which then is multiplexed as an XBARA input XB_In3 which will be connected via XBARA to XBARA_OUT20 (PwmCh0ExtA).&lt;/P&gt;&lt;P&gt;My initialization for this setup looks like this (using the NXP SDK version 2.7.0):&lt;/P&gt;&lt;LI-CODE lang="c"&gt;CLOCK_EnableClock(kCLOCK_PortE);

port_pin_config_t portConfig =
{
	.pullSelect = kPORT_PullUp,
	.slewRate = kPORT_FastSlewRate,
	.passiveFilterEnable = kPORT_PassiveFilterDisable,
	.openDrainEnable = kPORT_OpenDrainDisable,
	.driveStrength = kPORT_LowDriveStrength,
	.lockRegister = kPORT_UnlockRegister
};

portConfig.mux = kPORT_MuxAlt4;
PORT_SetPinConfig(PORTE, 25, &amp;amp;portConfig);

SIM-&amp;gt;SCGC4 = ((SIM-&amp;gt;SCGC4 &amp;amp;
(~SIM_SCGC4_PWM0_SM0_MASK))
  | SIM_SCGC4_PWM0_SM0(1)
);
XBARA_Init(XBARA);
XBARA_SetSignalsConnection(XBARA,
						   kXBARA_InputXbarIn3,
						   kXBARA_OutputPwmCh0ExtA);

pwm_config_t config;
PWM_GetDefaultConfig(&amp;amp;config);
config.prescale = kPWM_Prescale_Divide_128;
PWM_Init(PWM0, kPWM_Module_0, &amp;amp;config);
pwm_input_capture_param_t inputCaptureParams =
{
	.captureInputSel = false,
	.edgeCompareValue = 0,
	.edge0 = kPWM_RisingEdge,
	.edge1 = kPWM_Disable,
	.enableOneShotCapture = false,
	.fifoWatermark = 0
};
PWM_SetupInputCapture(PWM0, kPWM_Module_0, kPWM_PwmA, &amp;amp;inputCaptureParams);
PWM_StartTimer(PWM0, kPWM_Control_Module_0);&lt;/LI-CODE&gt;&lt;P&gt;After the initialization I poll the pwm registers manually by key-pressing in order to see if the capture works in any way:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;printf("Counter Register:                 %d\n", PWM0-&amp;gt;SM[0].CNT);
printf("Initial Count Register:           %d\n", PWM0-&amp;gt;SM[0].INIT);
printf("Value Register 0:                 %d\n", PWM0-&amp;gt;SM[0].VAL0);
printf("Value Register 1:                 %d\n", PWM0-&amp;gt;SM[0].VAL1);
printf("Value Register 2:                 %d\n", PWM0-&amp;gt;SM[0].VAL2);
printf("Value Register 3:                 %d\n", PWM0-&amp;gt;SM[0].VAL3);
printf("Value Register 4:                 %d\n", PWM0-&amp;gt;SM[0].VAL4);
printf("Value Register 5:                 %d\n", PWM0-&amp;gt;SM[0].VAL5);
printf("Status Register:                  %d\n", PWM0-&amp;gt;SM[0].STS);
printf("Capture Control A Register:       %d\n", PWM0-&amp;gt;SM[0].CAPTCTRLA);
printf("Capture Compare A Register:       %d\n", PWM0-&amp;gt;SM[0].CAPTCOMPA);
printf("Capture Value 0 Register:         %d\n", PWM0-&amp;gt;SM[0].CVAL0);
printf("Capture Value 1 Register:         %d\n", PWM0-&amp;gt;SM[0].CVAL1);
printf("Capture Value 2 Register:         %d\n", PWM0-&amp;gt;SM[0].CVAL2);
printf("Capture Value 3 Register:         %d\n", PWM0-&amp;gt;SM[0].CVAL3);
printf("Capture Value 4 Register:         %d\n", PWM0-&amp;gt;SM[0].CVAL4);
printf("Capture Value 5 Register:         %d\n", PWM0-&amp;gt;SM[0].CVAL5);
printf("Capture Value Cycle 0 Register:   %d\n", PWM0-&amp;gt;SM[0].CVAL0CYC);
printf("Capture Value Cycle 1 Register:   %d\n", PWM0-&amp;gt;SM[0].CVAL1CYC);
printf("Capture Value Cycle 2 Register:   %d\n", PWM0-&amp;gt;SM[0].CVAL2CYC);
printf("Capture Value Cycle 3 Register:   %d\n", PWM0-&amp;gt;SM[0].CVAL3CYC);
printf("Capture Value Cycle 4 Register:   %d\n", PWM0-&amp;gt;SM[0].CVAL4CYC);
printf("Capture Value Cycle 5 Register:   %d\n", PWM0-&amp;gt;SM[0].CVAL5CYC);&lt;/LI-CODE&gt;&lt;P&gt;Up to now, the only register that is changing perpetually is the Counter Register CNT. The other registers persist in the following states:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Counter Register:                 50810
Initial Count Register:           0
Value Register 0:                 0
Value Register 1:                 0
Value Register 2:                 0
Value Register 3:                 0
Value Register 4:                 0
Value Register 5:                 0
Status Register:                  28735
Capture Control A Register:       9
Capture Compare A Register:       0
Capture Value 0 Register:         0
Capture Value 1 Register:         0
Capture Value 2 Register:         0
Capture Value 3 Register:         0
Capture Value 4 Register:         0
Capture Value 5 Register:         0
Capture Value Cycle 0 Register:   0
Capture Value Cycle 1 Register:   0
Capture Value Cycle 2 Register:   0
Capture Value Cycle 3 Register:   0
Capture Value Cycle 4 Register:   0
Capture Value Cycle 5 Register:   0&lt;/LI-CODE&gt;&lt;P&gt;As no value or capture value register is changing in the process, I assume that there is still something important missing. Up to now, I am not even sure if I can use this module similar to my previous tests with the FTM module.&lt;/P&gt;&lt;P&gt;Can you tell me what the missing part is, or if the setup is possible with the eFlexPWM input capture in general?&lt;/P&gt;&lt;P&gt;Kind regards,&lt;BR /&gt;Julian&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 13:54:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/eFlexPWM-input-capture/m-p/1299746#M60936</guid>
      <dc:creator>SMNJS</dc:creator>
      <dc:date>2021-06-29T13:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: eFlexPWM input capture</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/eFlexPWM-input-capture/m-p/1302601#M60972</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Hope you are well. &lt;BR /&gt;The eFlexPWM can be used as input capture. To a detailed explanation and recommendations of how to setup this module you can check this document: &lt;A href="https://community.nxp.com/t5/Digital-Signal-Controllers/The-Capture-feature-of-eFlexPWM-module/ta-p/1123416" target="_blank"&gt;https://community.nxp.com/t5/Digital-Signal-Controllers/The-Capture-feature-of-eFlexPWM-module/ta-p/1123416&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Let me know if this is helpful, if you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 22:44:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/eFlexPWM-input-capture/m-p/1302601#M60972</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2021-07-05T22:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: eFlexPWM input capture</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/eFlexPWM-input-capture/m-p/1304722#M61007</link>
      <description>&lt;P&gt;Hello Omar,&lt;/P&gt;&lt;P&gt;thank you for your response!&lt;/P&gt;&lt;P&gt;I already studied your mentioned document during my initial setup of the PWM input capture.&lt;/P&gt;&lt;P&gt;In general I think the problem is based on the selection of my µC-Pin setup.&lt;BR /&gt;You can see that I am using the crossbar switch for my input signal in order to connect&amp;nbsp; my µC-Pin with the multiplex XB_In3 to "kXBARA_OutputPwmCh0ExtA".&lt;BR /&gt;After rereading the reference manual, I think the setup failed because I tried using a extern synchronisation input instead of using a correct µC-Pin with e.g. "FLEXPWM0_A0" multiplex.&lt;BR /&gt;&lt;BR /&gt;As I am currently not able to reroute the tacho-signal on my pcb to an other µC pin, I will get back to this case when I have the opportunity to make those changes.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;BR /&gt;Julian&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 13:14:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/eFlexPWM-input-capture/m-p/1304722#M61007</guid>
      <dc:creator>SMNJS</dc:creator>
      <dc:date>2021-07-08T13:14:03Z</dc:date>
    </item>
  </channel>
</rss>

