<?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>LPC MicrocontrollersのトピックRe: LPC55S69 ctimer pwm</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420373#M48044</link>
    <description>&lt;P&gt;srcClock_Hz = CTIMER_CLK_FREQ;&lt;/P&gt;&lt;P&gt;PRINTF（"CTimer 示例以生成 PWM 信号\r\n"）;&lt;/P&gt;&lt;P&gt;CTIMER_GetDefaultConfig（&amp;amp;config）;&lt;BR /&gt;timerClock = srcClock_Hz / （config.prescale + 1）;&lt;/P&gt;&lt;P&gt;CTIMER_Init（CTIMER， &amp;amp;config）;&lt;/P&gt;&lt;P&gt;这一段代码应该是pwm的两个通道可以公用的；&lt;/P&gt;&lt;P&gt;CTIMER_GetPwmPeriodValue(2, 20, timerClock);&lt;BR /&gt;CTIMER_SetupPwmPeriod(CTIMER, CTIMER_MAT_PWM_PERIOD_CHANNEL, CTIMER_MAT_OUT, g_pwmPeriod, g_pulsePeriod, false);&lt;BR /&gt;CTIMER_GetPwmPeriodValue1(2, 20, timerClock);&lt;BR /&gt;CTIMER_SetupPwmPeriod(CTIMER, CTIMER_MAT_PWM_PERIOD_CHANNEL, CTIMER_MAT_OUT_2, g_pwmPeriod_1, g_pulsePeriod_1, false);&lt;/P&gt;&lt;P&gt;为另一个通道配置了CTIMER_GetPwmPeriodValue1函数的2个宏定义，但输出的波形占空比和我的程序设定的不一样。&lt;/P&gt;&lt;P&gt;按道理同一个定时器的两个通道能够同时输出不同的波形？&lt;/P&gt;</description>
    <pubDate>Mon, 28 Feb 2022 08:13:51 GMT</pubDate>
    <dc:creator>wangyibin</dc:creator>
    <dc:date>2022-02-28T08:13:51Z</dc:date>
    <item>
      <title>LPC55S69 ctimer pwm</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420176#M48028</link>
      <description>&lt;P&gt;&lt;FONT&gt;在SDK&lt;/FONT&gt;&lt;FONT&gt;的 a&lt;/FONT&gt;&lt;FONT&gt;&lt;FONT&gt;lpcxpresso55s69_ctimer_pwm_example中提&lt;/FONT&gt;&lt;FONT&gt;&lt;FONT&gt;定时器的一个pwm通道进行配置，我想再配置另一个定时器的pwm输出，同时输出两路的pwm。&lt;/FONT&gt;&lt;FONT&gt;添加了kCTIMER_Match_2通道和volatile uint32_t g_pwmPeriod_1 = 0U;volatile uint32_t g_pulsePeriod_1 = 0U;的宏定义并为此&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT&gt;单独配置了CTIMER_GetPwmPeriodValue1函数如下图所示。但在我单独的运行第2张图的上面两行程序时，现象是：绿灯闪烁，蓝灯&lt;/FONT&gt;&lt;FONT&gt;常亮。单独的运行第2张图下面的两行程序时，现象是：蓝灯闪烁，绿灯常亮。这四行程序一起运行，现象是蓝绿混色在我规定的频率上&lt;/FONT&gt;&lt;FONT&gt;亮是符合预期的。&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wangyibin_1-1646016458055.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/171892iCA2A7314703D7FF4/image-size/large?v=v2&amp;amp;px=999" role="button" title="wangyibin_1-1646016458055.png" alt="wangyibin_1-1646016458055.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="wangyibin_0-1646016372786.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/171891i8032953D5840EE7E/image-size/large?v=v2&amp;amp;px=999" role="button" title="wangyibin_0-1646016372786.png" alt="wangyibin_0-1646016372786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;请问他们单独运行的时候为什么会相互干扰并且他们灯亮的颜色和程序并不是一致的呢？是不是我配置的有问题，CTIMER_SetupPwmPeriod（CTIMER， CTIMER_MAT_PWM_PERIOD_CHANNEL_1， CTIMER_MAT_OUT_2， g_pwmPeriod_1， g_pulsePeriod_1， false）;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT&gt;中的第二个参数也是定时器的通道可以两路pwm输出公用吗？&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;在这个函数中的第二个参数说是Specify the channel to control the PWM period？我想用ctimer2同时输出3路pwm，3路输出都用同一个通道可以吗？&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 03:05:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420176#M48028</guid>
      <dc:creator>wangyibin</dc:creator>
      <dc:date>2022-02-28T03:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 ctimer pwm</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420259#M48033</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think you can consider the following code.&lt;/P&gt;
&lt;P&gt;P0_10 FC6_SCK CT_INP10 &lt;FONT color="#FF0000"&gt;CT2MAT0&lt;/FONT&gt; FC1_TXD_SCL_&lt;BR /&gt;MISO&lt;/P&gt;
&lt;P&gt;The following code set up so that the PWM signal can output to CT2MT0 pin(P0_10)&lt;/P&gt;
&lt;P&gt;In the pin_mux.c, pls add the code in the void BOARD_InitPins(void)&lt;/P&gt;
&lt;P&gt;void BOARD_InitPins(void)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;.........................&lt;/P&gt;
&lt;P&gt;CLOCK_EnableClock(kCLOCK_Iocon);&lt;BR /&gt;//P0_10 func3=CT2_MAT0&lt;/P&gt;
&lt;P&gt;const uint32_t port0_pin10_config = (/* Pin is configured as CTIMER2_MAT1 */&lt;BR /&gt;IOCON_PIO_FUNC3 |&lt;BR /&gt;/* No addition pin function */&lt;BR /&gt;IOCON_PIO_MODE_INACT |&lt;BR /&gt;/* Standard mode, output slew rate control is enabled */&lt;BR /&gt;IOCON_PIO_SLEW_STANDARD |&lt;BR /&gt;/* Input function is not inverted */&lt;BR /&gt;IOCON_PIO_INV_DI |&lt;BR /&gt;/* Enables digital function */&lt;BR /&gt;IOCON_PIO_DIGITAL_EN |&lt;BR /&gt;/* Open drain is disabled */&lt;BR /&gt;IOCON_PIO_OPENDRAIN_DI);&lt;BR /&gt;/* PORT1 PIN4 (coords: 1) is configured as CTIMER2_MAT1 */&lt;BR /&gt;IOCON_PinMuxSet(IOCON, 0U, 10U, port0_pin10_config);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;For example, you want to add the CT2_MAT0 pin to output PWM signal.&lt;/P&gt;
&lt;P&gt;srcClock_Hz = CTIMER_CLK_FREQ;&lt;/P&gt;
&lt;P&gt;PRINTF("CTimer example to generate a PWM signal\r\n");&lt;/P&gt;
&lt;P&gt;CTIMER_GetDefaultConfig(&amp;amp;config);&lt;BR /&gt;timerClock = srcClock_Hz / (config.prescale + 1);&lt;/P&gt;
&lt;P&gt;CTIMER_Init(CTIMER, &amp;amp;config);&lt;/P&gt;
&lt;P&gt;/* Get the PWM period match value and pulse width match value of 20Khz PWM signal with 20% dutycycle */&lt;BR /&gt;CTIMER_GetPwmPeriodValue(20000, 20, timerClock);&lt;BR /&gt;CTIMER_SetupPwmPeriod(CTIMER, CTIMER_MAT_OUT, g_pwmPeriod, g_pulsePeriod, false);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//Can not use kCTIMER_Match_3, which is used to control PWM period&lt;/P&gt;
&lt;P&gt;//output PWM signal from the P0_10 &lt;BR /&gt;CTIMER_SetupPwmPeriod(CTIMER, kCTIMER_Match_0, g_pwmPeriod, g_pulsePeriod, false);&lt;/P&gt;
&lt;P&gt;CTIMER_StartTimer(CTIMER);&lt;/P&gt;
&lt;P&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;I do not have a test, pls test yourself.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 06:13:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420259#M48033</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-02-28T06:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 ctimer pwm</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420373#M48044</link>
      <description>&lt;P&gt;srcClock_Hz = CTIMER_CLK_FREQ;&lt;/P&gt;&lt;P&gt;PRINTF（"CTimer 示例以生成 PWM 信号\r\n"）;&lt;/P&gt;&lt;P&gt;CTIMER_GetDefaultConfig（&amp;amp;config）;&lt;BR /&gt;timerClock = srcClock_Hz / （config.prescale + 1）;&lt;/P&gt;&lt;P&gt;CTIMER_Init（CTIMER， &amp;amp;config）;&lt;/P&gt;&lt;P&gt;这一段代码应该是pwm的两个通道可以公用的；&lt;/P&gt;&lt;P&gt;CTIMER_GetPwmPeriodValue(2, 20, timerClock);&lt;BR /&gt;CTIMER_SetupPwmPeriod(CTIMER, CTIMER_MAT_PWM_PERIOD_CHANNEL, CTIMER_MAT_OUT, g_pwmPeriod, g_pulsePeriod, false);&lt;BR /&gt;CTIMER_GetPwmPeriodValue1(2, 20, timerClock);&lt;BR /&gt;CTIMER_SetupPwmPeriod(CTIMER, CTIMER_MAT_PWM_PERIOD_CHANNEL, CTIMER_MAT_OUT_2, g_pwmPeriod_1, g_pulsePeriod_1, false);&lt;/P&gt;&lt;P&gt;为另一个通道配置了CTIMER_GetPwmPeriodValue1函数的2个宏定义，但输出的波形占空比和我的程序设定的不一样。&lt;/P&gt;&lt;P&gt;按道理同一个定时器的两个通道能够同时输出不同的波形？&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 08:13:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420373#M48044</guid>
      <dc:creator>wangyibin</dc:creator>
      <dc:date>2022-02-28T08:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 ctimer pwm</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420423#M48049</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;For one CTimer module, all PWM channels(CT2_MAT0, CT2_MAT1,CT2_MAT2) must&amp;nbsp; have the same PWM cycle time, only the duty cycle can be different.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 08:55:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-ctimer-pwm/m-p/1420423#M48049</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-02-28T08:55:19Z</dc:date>
    </item>
  </channel>
</rss>

