<?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: 在M4核的PTA2上输出PWM波控制摄像头补光灯 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152043#M42199</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Has the problem been solved ?&lt;/P&gt;
&lt;P&gt;I will support you if you still have issues.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 10pt;"&gt;Jianyu:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;Have a great day,&lt;BR /&gt;TIC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2020 08:36:48 GMT</pubDate>
    <dc:creator>nxf58904</dc:creator>
    <dc:date>2020-09-11T08:36:48Z</dc:date>
    <item>
      <title>在M4核的PTA2上输出PWM波控制摄像头补光灯</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152001#M42196</link>
      <description>&lt;P&gt;参照SDK中实例simple_pwm，具体代码如下：&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="404740370_0-1599810128899.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/124912iDB0566603ABCA4E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="404740370_0-1599810128899.png" alt="404740370_0-1599810128899.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="404740370_1-1599810151413.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/124913iC315413A66BC19AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="404740370_1-1599810151413.png" alt="404740370_1-1599810151413.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt;===========================PTA2_PWM0_CH0======================&lt;BR /&gt;******************************************************************************/&lt;BR /&gt;volatile uint8_t updatedDutycycle = 10U;&lt;BR /&gt;void PTA2_PWM0_Init()&lt;BR /&gt;{&lt;BR /&gt;tpm_config_t tpmInfo;&lt;BR /&gt;tpm_chnl_pwm_signal_param_t tpmParam;&lt;/P&gt;&lt;P&gt;#ifndef TPM_LED_ON_LEVEL&lt;BR /&gt;#define TPM_LED_ON_LEVEL kTPM_LowTrue&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;/* Configure tpm params with frequency 24kHZ */&lt;BR /&gt;tpmParam.chnlNumber = (tpm_chnl_t)BOARD_TPM_CHANNEL;&lt;BR /&gt;tpmParam.level = TPM_LED_ON_LEVEL;&lt;BR /&gt;tpmParam.dutyCyclePercent = updatedDutycycle;&lt;/P&gt;&lt;P&gt;/* Print a note to terminal */&lt;BR /&gt;PRINTF("\r\nTPM example to output center-aligned PWM signal\r\n");&lt;BR /&gt;PRINTF("\r\nIf an LED is connected to the TPM pin, you will see a change in LED brightness if you enter different values");&lt;BR /&gt;PRINTF("\r\nIf no LED is connected to the TPM pin, then probe the signal using an oscilloscope");&lt;/P&gt;&lt;P&gt;TPM_GetDefaultConfig(&amp;amp;tpmInfo);&lt;BR /&gt;/* Initialize TPM module */&lt;BR /&gt;TPM_Init(BOARD_TPM_BASEADDR, &amp;amp;tpmInfo);&lt;/P&gt;&lt;P&gt;TPM_SetupPwm(BOARD_TPM_BASEADDR, &amp;amp;tpmParam, 1U, kTPM_CenterAlignedPwm, 24000U, TPM_SOURCE_CLOCK);&lt;/P&gt;&lt;P&gt;TPM_StartTimer(BOARD_TPM_BASEADDR, kTPM_SystemClock);&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int Ctrl_PTA2_PWM0_Proc(unsigned char setValue)&lt;BR /&gt;{&lt;BR /&gt;if(setValue &amp;gt; 9U)&lt;BR /&gt;{&lt;BR /&gt;DBG_PRINTF("Note: The range of value is 0 to 9.\r\n");&lt;BR /&gt;DBG_PRINTF("For example: If enter '5', the duty cycle will be set to 50 percent.\r\n");&lt;BR /&gt;return -1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;updatedDutycycle = setValue * 10U;&lt;/P&gt;&lt;P&gt;/* Disable channel output before updating the dutycycle */&lt;BR /&gt;TPM_UpdateChnlEdgeLevelSelect(BOARD_TPM_BASEADDR, (tpm_chnl_t)BOARD_TPM_CHANNEL, 0U);&lt;/P&gt;&lt;P&gt;/* Update PWM duty cycle */&lt;BR /&gt;TPM_UpdatePwmDutycycle(BOARD_TPM_BASEADDR, (tpm_chnl_t)BOARD_TPM_CHANNEL, kTPM_CenterAlignedPwm,&lt;BR /&gt;updatedDutycycle);&lt;/P&gt;&lt;P&gt;/* Start channel output with updated dutycycle */&lt;BR /&gt;TPM_UpdateChnlEdgeLevelSelect(BOARD_TPM_BASEADDR, (tpm_chnl_t)BOARD_TPM_CHANNEL, TPM_LED_ON_LEVEL);&lt;/P&gt;&lt;P&gt;DBG_PRINTF("The duty cycle was successfully updated!\r\n");&lt;/P&gt;&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="404740370_2-1599810223203.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/124914i544759D50A8CE71D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="404740370_2-1599810223203.png" alt="404740370_2-1599810223203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;。。。。&lt;BR /&gt;PTA2_PWM0_Init();&lt;BR /&gt;Ctrl_PTA2_PWM0_Proc(8);&lt;BR /&gt;。。。&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;我反复设置这个Ctrl_PTA2_PWM0_Proc(10);从0设置到10都没啥变化&lt;/P&gt;&lt;P&gt;用示波器看PTA2(威富模块的11脚)，一直输出高电平&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 07:44:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152001#M42196</guid>
      <dc:creator>404740370</dc:creator>
      <dc:date>2020-09-11T07:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: 在M4核的PTA2上输出PWM波控制摄像头补光灯</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152003#M42197</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Please check:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;#define TPM_SOURCE_CLOCK CLOCK_GetIpFreq(kCLOCK_Tpm2)&lt;/LI&gt;
&lt;LI&gt;CLOCK_SetIpSrc(kCLOCK_Tpm2, kCLOCK_IpSrcSysOscAsync);&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp; Tpm0 should be used to initialize clock.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks!&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 07:46:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152003#M42197</guid>
      <dc:creator>terry_lv</dc:creator>
      <dc:date>2020-09-11T07:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: 在M4核的PTA2上输出PWM波控制摄像头补光灯</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152015#M42198</link>
      <description>&lt;P&gt;OK了，THKs&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 07:58:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152015#M42198</guid>
      <dc:creator>404740370</dc:creator>
      <dc:date>2020-09-11T07:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: 在M4核的PTA2上输出PWM波控制摄像头补光灯</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152043#M42199</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Has the problem been solved ?&lt;/P&gt;
&lt;P&gt;I will support you if you still have issues.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 10pt;"&gt;Jianyu:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;Have a great day,&lt;BR /&gt;TIC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 08:36:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/%E5%9C%A8M4%E6%A0%B8%E7%9A%84PTA2%E4%B8%8A%E8%BE%93%E5%87%BAPWM%E6%B3%A2%E6%8E%A7%E5%88%B6%E6%91%84%E5%83%8F%E5%A4%B4%E8%A1%A5%E5%85%89%E7%81%AF/m-p/1152043#M42199</guid>
      <dc:creator>nxf58904</dc:creator>
      <dc:date>2020-09-11T08:36:48Z</dc:date>
    </item>
  </channel>
</rss>

