<?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: How to control the output of PWM signal, and how to use force_out? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1716051#M211908</link>
    <description>&lt;P&gt;I am using the RT1064 evaluation kit.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Sun, 03 Sep 2023 07:14:26 GMT</pubDate>
    <dc:creator>ahhhhhhhhhhh</dc:creator>
    <dc:date>2023-09-03T07:14:26Z</dc:date>
    <item>
      <title>How to control the output of PWM signal, and how to use force_out?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1715285#M211824</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I have generated 2 complemental PWM signal with dead time through eFlexPWM submodule0 A&amp;amp;B successfully, but I don't want to output the pulses continuously. I want to output several bursts of pulses. For example, 10 pulses(10us for each pulse) and 1s delay(no pulses out) as a cycle.&lt;/P&gt;&lt;P&gt;How can I generate such bursts pulses? Using timer? FORCE_OUT? Fault? And How to use the FORCE_OUT to generate such signal?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 17:26:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1715285#M211824</guid>
      <dc:creator>ahhhhhhhhhhh</dc:creator>
      <dc:date>2023-08-31T17:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the output of PWM signal, and how to use force_out?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1715314#M211825</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/222400"&gt;@ahhhhhhhhhhh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please point to me what MPU are you using?&lt;/P&gt;
&lt;P&gt;Is your board a custom or EVK?&lt;/P&gt;
&lt;P&gt;Are you using a BSP?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, share more details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 18:30:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1715314#M211825</guid>
      <dc:creator>Manuel_Salas</dc:creator>
      <dc:date>2023-08-31T18:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the output of PWM signal, and how to use force_out?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1716051#M211908</link>
      <description>&lt;P&gt;I am using the RT1064 evaluation kit.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 07:14:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1716051#M211908</guid>
      <dc:creator>ahhhhhhhhhhh</dc:creator>
      <dc:date>2023-09-03T07:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the output of PWM signal, and how to use force_out?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1717423#M212061</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/222400"&gt;@ahhhhhhhhhhh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My recommendation is:&lt;/P&gt;
&lt;P&gt;With 2 PWM signals(PWM1 and PWM2), use PWM1 (which has a a longer duty cycle at a lower frequency) to trigger PWM2 (wich has faster frequency) this way, with the duty cycle of PWM1 you can control the pulses generated on PWM2.&lt;/P&gt;
&lt;P&gt;You can use the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;on Chip Cross Triggers&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;module from the RT. Chapter 60 from reference manual.&lt;/P&gt;
&lt;P&gt;My second recommendation is to use a timer&amp;nbsp; to toggle a GPIO and count the times it have been triggered and after the amount of pulses you want you can stop or disable the timer.&lt;/P&gt;
&lt;P&gt;Best Regards, Miguel.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 18:55:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1717423#M212061</guid>
      <dc:creator>Miguel04</dc:creator>
      <dc:date>2023-09-05T18:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the output of PWM signal, and how to use force_out?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1721600#M212496</link>
      <description>&lt;P&gt;Thanks a lot. I have used timer to control two eFlexPWM signal. But it still have some problems. when I disable the output of PWM, PWMB still output high value. As the picture shows below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.jpg" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240699i0BBB30FB3AA226BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pic.jpg" alt="pic.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;void EXAMPLE_GPT_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;/* Clear interrupt flag.*/&lt;BR /&gt;GPT_ClearStatusFlags(EXAMPLE_GPT, kGPT_OutputCompare1Flag);&lt;BR /&gt;PWM_StartTimer(BOARD_PWM_BASEADDR, kPWM_Control_Module_2);&lt;BR /&gt;PWM_OutputEnable(BOARD_PWM_BASEADDR, kPWM_PwmA, kPWM_Module_2);&lt;BR /&gt;PWM_OutputEnable(BOARD_PWM_BASEADDR, kPWM_PwmB, kPWM_Module_2);&lt;BR /&gt;for (uint32_t i = 0; i &amp;lt; 20000; i++) {&lt;BR /&gt;__NOP(); // Introduce a 100us delay&lt;BR /&gt;}&lt;BR /&gt;PWM_StopTimer(BOARD_PWM_BASEADDR, kPWM_Control_Module_2);&lt;BR /&gt;BOARD_PWM_BASEADDR-&amp;gt;OUTEN = 0x00;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void PWM_DRV_Init3PhPwm(void)&lt;BR /&gt;{&lt;BR /&gt;uint16_t deadTimeVal;&lt;BR /&gt;pwm_signal_param_t pwmSignal[2];&lt;BR /&gt;uint32_t pwmSourceClockInHz;&lt;BR /&gt;uint32_t pwmFrequencyInHz = APP_DEFAULT_PWM_FREQUENCE;&lt;/P&gt;&lt;P&gt;pwmSourceClockInHz = PWM_SRC_CLK_FREQ;&lt;/P&gt;&lt;P&gt;/* Set deadtime count, we set this to about 1000ns */&lt;BR /&gt;deadTimeVal = ((uint64_t)pwmSourceClockInHz * 1000) / 1000000000;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pwmSignal[0].pwmChannel = kPWM_PwmA;&lt;BR /&gt;pwmSignal[0].level = kPWM_HighTrue;&lt;BR /&gt;pwmSignal[0].dutyCyclePercent = 50; /* 1 percent dutycycle */&lt;BR /&gt;pwmSignal[0].deadtimeValue = deadTimeVal;&lt;BR /&gt;pwmSignal[0].faultState = kPWM_PwmFaultState0;&lt;BR /&gt;pwmSignal[0].pwmchannelenable = true;&lt;/P&gt;&lt;P&gt;pwmSignal[1].pwmChannel = kPWM_PwmB;&lt;BR /&gt;pwmSignal[1].level = kPWM_HighTrue;&lt;BR /&gt;/* Dutycycle field of PWM B does not matter as we are running in PWM A complementary mode */&lt;BR /&gt;pwmSignal[1].dutyCyclePercent = 50;&lt;BR /&gt;pwmSignal[1].deadtimeValue = deadTimeVal;&lt;BR /&gt;pwmSignal[1].faultState = kPWM_PwmFaultState0;&lt;BR /&gt;pwmSignal[1].pwmchannelenable = true;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*********** PWM1_sbm2 - configuration, setup PWM AB 2channels ************/&lt;BR /&gt;PWM_SetupPwm(BOARD_PWM_BASEADDR, kPWM_Module_2, pwmSignal, 2, kPWM_SignedCenterAligned, pwmFrequencyInHz,&lt;BR /&gt;pwmSourceClockInHz);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;/* Structure of initialize PWM */&lt;BR /&gt;pwm_config_t pwmConfig;&lt;BR /&gt;pwm_fault_param_t faultConfig;&lt;BR /&gt;uint32_t pwmVal = 50;&lt;/P&gt;&lt;P&gt;/* Board pin, clock, debug console init */&lt;BR /&gt;BOARD_ConfigMPU();&lt;BR /&gt;BOARD_InitBootPins();&lt;BR /&gt;BOARD_InitBootClocks();&lt;BR /&gt;BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;CLOCK_SetDiv(kCLOCK_AhbDiv, 0x1); /* Set AHB PODF to 0, divide by 2 */&lt;BR /&gt;CLOCK_SetDiv(kCLOCK_IpgDiv, 0x3); /* Set IPG PODF to 0, divede by 1 */&lt;BR /&gt;// CLOCK_SetDiv(kCLOCK_AhbDiv, 0x2); /* Set AHB PODF to 2, divide by 3 */&lt;BR /&gt;// CLOCK_SetDiv(kCLOCK_IpgDiv, 0x3); /* Set IPG PODF to 3, divede by 4 */&lt;BR /&gt;/* Set the PWM Fault inputs to a low value */&lt;BR /&gt;XBARA_Init(XBARA1);&lt;BR /&gt;XBARA_SetSignalsConnection(XBARA1, kXBARA1_InputLogicHigh, kXBARA1_OutputFlexpwm1Fault0);&lt;BR /&gt;XBARA_SetSignalsConnection(XBARA1, kXBARA1_InputLogicHigh, kXBARA1_OutputFlexpwm1Fault1);&lt;BR /&gt;XBARA_SetSignalsConnection(XBARA1, kXBARA1_InputLogicHigh, kXBARA1_OutputFlexpwm1234Fault2);&lt;BR /&gt;XBARA_SetSignalsConnection(XBARA1, kXBARA1_InputLogicHigh, kXBARA1_OutputFlexpwm1234Fault3);&lt;/P&gt;&lt;P&gt;PRINTF("FlexPWM driver example\n");&lt;/P&gt;&lt;P&gt;PWM_GetDefaultConfig(&amp;amp;pwmConfig);&lt;BR /&gt;&lt;BR /&gt;/* Use full cycle reload */&lt;BR /&gt;pwmConfig.reloadLogic = kPWM_ReloadPwmFullCycle;&lt;BR /&gt;/* PWM A &amp;amp; PWM B form a complementary PWM pair */&lt;BR /&gt;pwmConfig.pairOperation = kPWM_ComplementaryPwmA;&lt;BR /&gt;pwmConfig.enableDebugMode = true;&lt;BR /&gt;&lt;BR /&gt;#ifdef DEMO_PWM_CLOCK_DEVIDER&lt;BR /&gt;pwmConfig.prescale = DEMO_PWM_CLOCK_DEVIDER;&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Initialize submodule 2 */&lt;BR /&gt;if (PWM_Init(BOARD_PWM_BASEADDR, kPWM_Module_2, &amp;amp;pwmConfig) == kStatus_Fail)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("PWM initialization failed\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;PWM_FaultDefaultConfig(&amp;amp;faultConfig);&lt;/P&gt;&lt;P&gt;#ifdef DEMO_PWM_FAULT_LEVEL&lt;BR /&gt;faultConfig.faultLevel = DEMO_PWM_FAULT_LEVEL;&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;/* Sets up the PWM fault protection */&lt;BR /&gt;PWM_SetupFaults(BOARD_PWM_BASEADDR, kPWM_Fault_0, &amp;amp;faultConfig);&lt;BR /&gt;PWM_SetupFaults(BOARD_PWM_BASEADDR, kPWM_Fault_1, &amp;amp;faultConfig);&lt;BR /&gt;PWM_SetupFaults(BOARD_PWM_BASEADDR, kPWM_Fault_2, &amp;amp;faultConfig);&lt;BR /&gt;PWM_SetupFaults(BOARD_PWM_BASEADDR, kPWM_Fault_3, &amp;amp;faultConfig);&lt;/P&gt;&lt;P&gt;/* Set PWM fault disable mapping for submodule 2 */&lt;BR /&gt;PWM_SetupFaultDisableMap(BOARD_PWM_BASEADDR, kPWM_Module_2, kPWM_PwmA, kPWM_faultchannel_0,&lt;BR /&gt;kPWM_FaultDisable_0 | kPWM_FaultDisable_1 | kPWM_FaultDisable_2 | kPWM_FaultDisable_3);&lt;BR /&gt;PWM_SetupFaultDisableMap(BOARD_PWM_BASEADDR, kPWM_Module_2, kPWM_PwmB, kPWM_faultchannel_0,&lt;BR /&gt;kPWM_FaultDisable_0 | kPWM_FaultDisable_1 | kPWM_FaultDisable_2 | kPWM_FaultDisable_3);&lt;BR /&gt;&lt;BR /&gt;/* Call the init function with demo configuration */&lt;BR /&gt;PWM_DRV_Init3PhPwm();&lt;/P&gt;&lt;P&gt;/* Set the load okay bit for all submodules to load registers from their buffer */&lt;BR /&gt;PWM_SetPwmLdok(BOARD_PWM_BASEADDR, kPWM_Control_Module_2,true);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;uint32_t gptFreq = 25000000;&lt;BR /&gt;gpt_config_t gptConfig;&lt;/P&gt;&lt;P&gt;/* Board pin, clock, debug console init */&lt;BR /&gt;BOARD_ConfigMPU();&lt;BR /&gt;BOARD_InitBootPins();&lt;BR /&gt;BOARD_InitBootClocks();&lt;BR /&gt;BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;GPT_GetDefaultConfig(&amp;amp;gptConfig);&lt;/P&gt;&lt;P&gt;/* Initialize GPT module */&lt;BR /&gt;GPT_Init(EXAMPLE_GPT, &amp;amp;gptConfig);&lt;/P&gt;&lt;P&gt;/* Divide GPT clock source frequency by 3 inside GPT module */&lt;BR /&gt;GPT_SetClockDivider(EXAMPLE_GPT, 3);&lt;BR /&gt;/* Set both GPT modules to 100us duration */&lt;BR /&gt;GPT_SetOutputCompareValue(EXAMPLE_GPT, kGPT_OutputCompare_Channel1, gptFreq);&lt;/P&gt;&lt;P&gt;/* Enable GPT Output Compare1 interrupt */&lt;BR /&gt;GPT_EnableInterrupts(EXAMPLE_GPT, kGPT_OutputCompare1InterruptEnable);&lt;/P&gt;&lt;P&gt;EnableIRQ(GPT_IRQ_ID);&lt;/P&gt;&lt;P&gt;GPT_StartTimer(EXAMPLE_GPT);&lt;/P&gt;&lt;P&gt;while (1U)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;}&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>Wed, 13 Sep 2023 03:37:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-the-output-of-PWM-signal-and-how-to-use-force-out/m-p/1721600#M212496</guid>
      <dc:creator>ahhhhhhhhhhh</dc:creator>
      <dc:date>2023-09-13T03:37:34Z</dc:date>
    </item>
  </channel>
</rss>

